summaryrefslogtreecommitdiffstats
path: root/Lib/test/leakers/test_generator_cycle.py
blob: b0aba4349b9b15e3c8f6820645e49f37dcc576d8 (plain)
1
2
3
4
5
6
7
8
9
10

# 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()