summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_generators.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-12-03 20:01:02 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-12-03 20:01:02 (GMT)
commit44eeaec173d66769835e4f8a2a0ad7e605fe6aef (patch)
tree64c0a3b6fdddbbd79d15a9b7ce1021f470701566 /Lib/test/test_generators.py
parentcbcfe4f3e47d420742f726415705b116672d6779 (diff)
downloadcpython-44eeaec173d66769835e4f8a2a0ad7e605fe6aef.zip
cpython-44eeaec173d66769835e4f8a2a0ad7e605fe6aef.tar.gz
cpython-44eeaec173d66769835e4f8a2a0ad7e605fe6aef.tar.bz2
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.)
Diffstat (limited to 'Lib/test/test_generators.py')
-rw-r--r--Lib/test/test_generators.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
index 5d50187..ce3db72 100644
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
@@ -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():