summaryrefslogtreecommitdiff
path: root/Objects/moduleobject.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2022-11-16 09:37:14 -0700
committerGitHub <noreply@github.com>2022-11-16 09:37:14 -0700
commit5f55067e238c21de25f09ece9bb24ae8c42d02b4 (patch)
treef3fbce5e16aaa3a8871518c4ccb18bc8a1d86e9e /Objects/moduleobject.c
parent5cfb7d19f5242c9b8ffd2fe30a24569e85a99e1d (diff)
downloadcpython-git-5f55067e238c21de25f09ece9bb24ae8c42d02b4.tar.gz
gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)
https://github.com/python/cpython/issues/81057
Diffstat (limited to 'Objects/moduleobject.c')
-rw-r--r--Objects/moduleobject.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 4a423a719e..8e03f2446f 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -218,6 +218,7 @@ _PyModule_CreateInitialized(PyModuleDef* module, int module_api_version)
_Py_PackageContext, and PyModule_Create*() will substitute this
(if the name actually matches).
*/
+#define _Py_PackageContext (_PyRuntime.imports.pkgcontext)
if (_Py_PackageContext != NULL) {
const char *p = strrchr(_Py_PackageContext, '.');
if (p != NULL && strcmp(module->m_name, p+1) == 0) {
@@ -225,6 +226,7 @@ _PyModule_CreateInitialized(PyModuleDef* module, int module_api_version)
_Py_PackageContext = NULL;
}
}
+#undef _Py_PackageContext
if ((m = (PyModuleObject*)PyModule_New(name)) == NULL)
return NULL;