mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
19 lines
245 B
Python
19 lines
245 B
Python
import gc
|
|
|
|
# Taken from test_generators
|
|
|
|
def f():
|
|
try:
|
|
yield
|
|
except GeneratorExit:
|
|
yield "foo!"
|
|
|
|
def inner_leak():
|
|
g = f()
|
|
g.next()
|
|
|
|
def leak():
|
|
inner_leak()
|
|
gc.collect()
|
|
gc.collect()
|
|
gc.collect()
|