aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_generators.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_generators.py')
-rw-r--r--Lib/test/test_generators.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
index 77c477fe35a..17523ba71c9 100644
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
@@ -805,6 +805,26 @@ SyntaxError: invalid syntax
... yield 2 # because it's a generator
Traceback (most recent call last):
SyntaxError: 'return' with argument inside generator (<string>, line 8)
+
+This one caused a crash (see SF bug 567538):
+
+>>> def f():
+... for i in range(3):
+... try:
+... continue
+... finally:
+... yield i
+...
+>>> g = f()
+>>> print g.next()
+0
+>>> print g.next()
+1
+>>> print g.next()
+2
+>>> print g.next()
+Traceback (most recent call last):
+StopIteration
"""
# conjoin is a simple backtracking generator, named in honor of Icon's