diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2022-11-16 09:37:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-16 09:37:14 -0700 |
commit | 5f55067e238c21de25f09ece9bb24ae8c42d02b4 (patch) | |
tree | f3fbce5e16aaa3a8871518c4ccb18bc8a1d86e9e /Python/importdl.c | |
parent | 5cfb7d19f5242c9b8ffd2fe30a24569e85a99e1d (diff) | |
download | cpython-5f55067e238c21de25f09ece9bb24ae8c42d02b4.tar.gz cpython-5f55067e238c21de25f09ece9bb24ae8c42d02b4.zip |
gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)
https://github.com/python/cpython/issues/81057
Diffstat (limited to 'Python/importdl.c')
-rw-r--r-- | Python/importdl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/importdl.c b/Python/importdl.c index 870ae273007..40227674ca4 100644 --- a/Python/importdl.c +++ b/Python/importdl.c @@ -160,6 +160,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp) p0 = (PyModInitFunction)exportfunc; /* Package context is needed for single-phase init */ +#define _Py_PackageContext (_PyRuntime.imports.pkgcontext) oldcontext = _Py_PackageContext; _Py_PackageContext = PyUnicode_AsUTF8(name_unicode); if (_Py_PackageContext == NULL) { @@ -168,6 +169,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp) } m = _PyImport_InitFunc_TrampolineCall(p0); _Py_PackageContext = oldcontext; +#undef _Py_PackageContext if (m == NULL) { if (!PyErr_Occurred()) { |