mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +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
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue