mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Issue #10241: Clear extension module dict copies at interpreter shutdown.
Patch by Neil Schemenauer, minimally modified.
This commit is contained in:
parent
a68cbfa556
commit
84f31a5676
4 changed files with 33 additions and 0 deletions
|
|
@ -380,6 +380,8 @@ PyImport_Cleanup(void)
|
|||
builtins = interp->builtins;
|
||||
interp->builtins = PyDict_New();
|
||||
Py_DECREF(builtins);
|
||||
/* Clear module dict copies stored in the interpreter state */
|
||||
_PyState_ClearModules();
|
||||
/* Collect references */
|
||||
_PyGC_CollectNoFail();
|
||||
/* Dump GC stats before it's too late, since it uses the warnings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue