mirror of
https://github.com/python/cpython.git
synced 2025-07-10 04:45:36 +00:00
Implement PEP 3121: new module initialization and finalization API.
This commit is contained in:
parent
cdf94635d7
commit
1a21451b1d
113 changed files with 2230 additions and 855 deletions
|
@ -193,6 +193,7 @@ Py_InitializeEx(int install_sigs)
|
|||
bimod = _PyBuiltin_Init();
|
||||
if (bimod == NULL)
|
||||
Py_FatalError("Py_Initialize: can't initialize builtins modules");
|
||||
_PyImport_FixupExtension(bimod, "builtins", "builtins");
|
||||
interp->builtins = PyModule_GetDict(bimod);
|
||||
if (interp->builtins == NULL)
|
||||
Py_FatalError("Py_Initialize: can't initialize builtins dict");
|
||||
|
@ -208,7 +209,7 @@ Py_InitializeEx(int install_sigs)
|
|||
if (interp->sysdict == NULL)
|
||||
Py_FatalError("Py_Initialize: can't initialize sys dict");
|
||||
Py_INCREF(interp->sysdict);
|
||||
_PyImport_FixupExtension("sys", "sys");
|
||||
_PyImport_FixupExtension(sysmod, "sys", "sys");
|
||||
PySys_SetPath(Py_GetPath());
|
||||
PyDict_SetItemString(interp->sysdict, "modules",
|
||||
interp->modules);
|
||||
|
@ -223,9 +224,6 @@ Py_InitializeEx(int install_sigs)
|
|||
|
||||
_PyImport_Init();
|
||||
|
||||
/* phase 2 of builtins */
|
||||
_PyImport_FixupExtension("builtins", "builtins");
|
||||
|
||||
_PyImportHooks_Init();
|
||||
|
||||
if (install_sigs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue