Fix issue #1705170 (backport from trunk)

This commit is contained in:
Nick Coghlan 2007-11-07 12:26:40 +00:00
parent 2e49f781cb
commit e53fcfd7d3
3 changed files with 24 additions and 0 deletions

View file

@ -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()")