mirror of
https://github.com/python/cpython.git
synced 2025-10-04 22:20:46 +00:00
Fix issue #1705170 (backport from trunk)
This commit is contained in:
parent
2e49f781cb
commit
e53fcfd7d3
3 changed files with 24 additions and 0 deletions
|
@ -25,6 +25,10 @@ class GeneratorContextManager(object):
|
|||
else:
|
||||
raise RuntimeError("generator didn't stop")
|
||||
else:
|
||||
if value is None:
|
||||
# Need to force instantiation so we can reliably
|
||||
# tell if we get the same exception back
|
||||
value = type()
|
||||
try:
|
||||
self.gen.throw(type, value, traceback)
|
||||
raise RuntimeError("generator didn't stop after throw()")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue