Open
Description
Bug report
python-trio/trio#2514 (comment)
import weakref
import trio
import gc
async def f():
async with trio.open_nursery() as nursery:
nursery.cancel_scope.cancel()
h = weakref.ref(nursery)
del nursery
await trio.lowlevel.checkpoint()
print(h(), gc.get_referrers(h()) if h() is not None else [])
trio.run(f)
(I haven't figured out how to reproduce without the import trio
)
I bisected this to 1e197e6
Previously:
None []
Now:
<trio.Nursery object at 0x7f3f5585d4f0> [NurseryManager(strict_exception_groups=False), <cell at 0x7f3f5585d540: Nursery object at 0x7f3f5585d4f0>, <frame at 0x7f3f55e220c0, file '/workspaces/trio/trio/_core/_run.py', line 1005, code _nested_child_finished>]
I'm not certain this should be a bug, but raising because I'm confused as to the cause.