bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow() (GH-7467)

This commit is contained in:
Yury Selivanov 2018-06-07 20:31:26 -04:00 committed by GitHub
parent 378c53cc31
commit 52698c7ad9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 87 additions and 9 deletions

View file

@ -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: