summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-03-14 20:01:35 (GMT)
committerGitHub <noreply@github.com>2023-03-14 20:01:35 (GMT)
commitcdb21ba74d933e262bc1696b6ce78b50cb5a4443 (patch)
treebfdf1ff0a564d9b7bc3f7288f115ccd3bc9c3d12 /Python/pystate.c
parent80abd62647b2a36947a11a6a8e395061be6f0c61 (diff)
downloadcpython-cdb21ba74d933e262bc1696b6ce78b50cb5a4443.zip
cpython-cdb21ba74d933e262bc1696b6ce78b50cb5a4443.tar.gz
cpython-cdb21ba74d933e262bc1696b6ce78b50cb5a4443.tar.bz2
gh-102660: Handle m_copy Specially for the sys and builtins Modules (gh-102661)
It doesn't make sense to use multi-phase init for these modules. Using a per-interpreter "m_copy" (instead of PyModuleDef.m_base.m_copy) makes this work okay. (This came up while working on gh-101660.) Note that we might instead end up disallowing re-load for sys/builtins since they are so special. https://github.com/python/cpython/issues/102660
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 28606e4..3a2966c 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -805,6 +805,7 @@ interpreter_clear(PyInterpreterState *interp, PyThreadState *tstate)
assert(interp->imports.importlib == NULL);
assert(interp->imports.import_func == NULL);
+ Py_CLEAR(interp->sysdict_copy);
Py_CLEAR(interp->builtins_copy);
Py_CLEAR(interp->dict);
#ifdef HAVE_FORK