Arcadiy Ivanov <arca...@ivanov.biz> added the comment:
> If sys.modules['_ast'] is cleared and then _ast is imported again, > _PyState_AddModule() is called to store the new _ast module instance which > calls astmodule_clear() on the old module instance. I'm confused about this. In the repro below the sys.modules.clear() is indeed cleared, but references to all modules are retained. Where is the garbage collection/module re-initialization coming from? All of the references are live. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41261> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com