diff options
Diffstat (limited to 'tests/stress/recursive_gen.py')
-rw-r--r-- | tests/stress/recursive_gen.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/stress/recursive_gen.py b/tests/stress/recursive_gen.py index 0e0d3914e..8c2139765 100644 --- a/tests/stress/recursive_gen.py +++ b/tests/stress/recursive_gen.py @@ -3,16 +3,20 @@ # simple "yield from" recursion def gen(): yield from gen() + + try: list(gen()) except RuntimeError: - print('RuntimeError') + print("RuntimeError") # recursion via an iterator over a generator def gen2(): for x in gen2(): yield x + + try: next(gen2()) except RuntimeError: - print('RuntimeError') + print("RuntimeError") |