diff --git a/Lib/test/leakers/test_generator_cycle.py b/Lib/test/leakers/test_generator_cycle.py new file mode 100644 index 00000000000..d2fa72ca8e8 --- /dev/null +++ b/Lib/test/leakers/test_generator_cycle.py @@ -0,0 +1,11 @@ + +# This leaks since the introduction of yield-expr and the use of generators +# as coroutines, trunk revision 39239. The cycle-GC doesn't seem to pick up +# the cycle, or decides it can't clean it up. + +def leak(): + def gen(): + while True: + yield g + g = gen() +