STINNER Victor added the comment: contextmanager_leak2.py: even simpler example, storing a current frame in a local variable of the frame is enough.
generator_workaround.patch is another workaround: call frame.clear() when at generator exit to explicitly break the reference cycle. ---------- Added file: http://bugs.python.org/file32954/contextmanager_leak2.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19880> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com