mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() (GH-7467)
This commit is contained in:
parent
378c53cc31
commit
52698c7ad9
5 changed files with 87 additions and 9 deletions
|
@ -187,7 +187,7 @@ class _AsyncGeneratorContextManager(_GeneratorContextManagerBase,
|
|||
# in this implementation
|
||||
try:
|
||||
await self.gen.athrow(typ, value, traceback)
|
||||
raise RuntimeError("generator didn't stop after throw()")
|
||||
raise RuntimeError("generator didn't stop after athrow()")
|
||||
except StopAsyncIteration as exc:
|
||||
return exc is not value
|
||||
except RuntimeError as exc:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue