From 40322e6ad5f705e294ded37fa4a682f065ec80a2 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sun, 11 Aug 2013 00:30:09 +0200 Subject: Issue #10241: Clear extension module dict copies at interpreter shutdown. Patch by Neil Schemenauer, minimally modified. (re-apply after fix for tkinter-related crash) --- Python/import.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Python/import.c') diff --git a/Python/import.c b/Python/import.c index be73d4bba8..113123d564 100644 --- a/Python/import.c +++ b/Python/import.c @@ -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 -- cgit v1.2.1