diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-06-11 05:26:20 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-06-11 05:26:20 (GMT) |
commit | 1a21451b1d73b65af949193208372e86bf308411 (patch) | |
tree | 8e98d7be9e249b011ae9380479656e5284ec0234 /Python/pythonrun.c | |
parent | cdf94635d7e364f9ce1905bafa5b540f4d16147c (diff) | |
download | cpython-1a21451b1d73b65af949193208372e86bf308411.zip cpython-1a21451b1d73b65af949193208372e86bf308411.tar.gz cpython-1a21451b1d73b65af949193208372e86bf308411.tar.bz2 |
Implement PEP 3121: new module initialization and finalization API.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 24517e4..3df5793 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -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) |