summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-10 16:21:34 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-10 16:21:34 (GMT)
commit013bb91aa304062bb65fe8951e2d263f2065ee56 (patch)
tree27febdf4f9bb1022798cdf8f44eef801987064e9 /Python/pystate.c
parent761412246751bbf32bfa6315a9888d6cbf322ee5 (diff)
downloadcpython-013bb91aa304062bb65fe8951e2d263f2065ee56.zip
cpython-013bb91aa304062bb65fe8951e2d263f2065ee56.tar.gz
cpython-013bb91aa304062bb65fe8951e2d263f2065ee56.tar.bz2
Issue #19255: The builtins module is restored to initial value before
cleaning other modules. The sys and builtins modules are cleaned last.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 19fceb7..2ac2fd5 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -72,6 +72,7 @@ PyInterpreterState_New(void)
interp->modules_by_index = NULL;
interp->sysdict = NULL;
interp->builtins = NULL;
+ interp->builtins_copy = NULL;
interp->tstate_head = NULL;
interp->codec_search_path = NULL;
interp->codec_search_cache = NULL;
@@ -115,6 +116,7 @@ PyInterpreterState_Clear(PyInterpreterState *interp)
Py_CLEAR(interp->modules_by_index);
Py_CLEAR(interp->sysdict);
Py_CLEAR(interp->builtins);
+ Py_CLEAR(interp->builtins_copy);
Py_CLEAR(interp->importlib);
}