mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)
https://github.com/python/cpython/issues/81057
This commit is contained in:
parent
5cfb7d19f5
commit
5f55067e23
24 changed files with 241 additions and 130 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue