summaryrefslogtreecommitdiffstats
path: root/Lib/contextlib.py
diff options
context:
space:
mode:
authorOfey Chan <ofey206@gmail.com>2022-09-30 08:43:02 (GMT)
committerGitHub <noreply@github.com>2022-09-30 08:43:02 (GMT)
commit83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65 (patch)
tree31d942b63699bc5e1848ffb6f85901fe8b93301c /Lib/contextlib.py
parent9a11ed8e50492d327e4de0a8f3a473e788b14a6f (diff)
downloadcpython-83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65.zip
cpython-83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65.tar.gz
cpython-83a3de4e0632d90e0d1d5a9b8859a94c9ac25f65.tar.bz2
gh-96348: Deprecate the 3-arg signature of coroutine.throw and generator.throw (GH-96428)
Diffstat (limited to 'Lib/contextlib.py')
-rw-r--r--Lib/contextlib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/contextlib.py b/Lib/contextlib.py
index 625bb33..d582221 100644
--- a/Lib/contextlib.py
+++ b/Lib/contextlib.py
@@ -152,7 +152,7 @@ class _GeneratorContextManager(
# tell if we get the same exception back
value = typ()
try:
- self.gen.throw(typ, value, traceback)
+ self.gen.throw(value)
except StopIteration as exc:
# Suppress StopIteration *unless* it's the same exception that
# was passed to throw(). This prevents a StopIteration
@@ -219,7 +219,7 @@ class _AsyncGeneratorContextManager(
# tell if we get the same exception back
value = typ()
try:
- await self.gen.athrow(typ, value, traceback)
+ await self.gen.athrow(value)
except StopAsyncIteration as exc:
# Suppress StopIteration *unless* it's the same exception that
# was passed to throw(). This prevents a StopIteration