Patch #1537 from Chad Austin

Change GeneratorExit's base class from Exception to BaseException
(This time I'm applying the patch to the correct sandbox.)
This commit is contained in:
Christian Heimes 2007-12-03 20:01:02 +00:00
parent cbcfe4f3e4
commit 44eeaec173
6 changed files with 25 additions and 11 deletions

View file

@ -1658,6 +1658,19 @@ And finalization:
exiting
GeneratorExit is not caught by except Exception:
>>> def f():
... try: yield
... except Exception: print 'except'
... finally: print 'finally'
>>> g = f()
>>> g.next()
>>> del g
finally
Now let's try some ill-behaved generators:
>>> def f():