Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 6328:dfeaf965f48a legacy-trunk
Py_Initialize(): move the call to _PyImport_FixupExtension() to after
the phase 2 init of the __builtin__ module, so that multiple
interpreters will get the right exceptions.
| author | Barry Warsaw <barry@python.org> |
|---|---|
| date | Thu, 18 Sep 1997 16:42:02 +0000 |
| parents | 05d943c4597c |
| children | f6ef9af4c8b9 |
comparison
equal
deleted
inserted
replaced
| 6327:4b4775b49bfa | 6328:dfeaf965f48a |
|---|---|
| 134 bimod = _PyBuiltin_Init_1(); | 134 bimod = _PyBuiltin_Init_1(); |
| 135 if (bimod == NULL) | 135 if (bimod == NULL) |
| 136 Py_FatalError("Py_Initialize: can't initialize __builtin__"); | 136 Py_FatalError("Py_Initialize: can't initialize __builtin__"); |
| 137 interp->builtins = PyModule_GetDict(bimod); | 137 interp->builtins = PyModule_GetDict(bimod); |
| 138 Py_INCREF(interp->builtins); | 138 Py_INCREF(interp->builtins); |
| 139 _PyImport_FixupExtension("__builtin__", "__builtin__"); | |
| 140 | 139 |
| 141 sysmod = _PySys_Init(); | 140 sysmod = _PySys_Init(); |
| 142 if (sysmod == NULL) | 141 if (sysmod == NULL) |
| 143 Py_FatalError("Py_Initialize: can't initialize sys"); | 142 Py_FatalError("Py_Initialize: can't initialize sys"); |
| 144 interp->sysdict = PyModule_GetDict(sysmod); | 143 interp->sysdict = PyModule_GetDict(sysmod); |
| 148 PyDict_SetItemString(interp->sysdict, "modules", | 147 PyDict_SetItemString(interp->sysdict, "modules", |
| 149 interp->modules); | 148 interp->modules); |
| 150 | 149 |
| 151 /* phase 2 of builtins */ | 150 /* phase 2 of builtins */ |
| 152 _PyBuiltin_Init_2(interp->builtins); | 151 _PyBuiltin_Init_2(interp->builtins); |
| 152 _PyImport_FixupExtension("__builtin__", "__builtin__"); | |
| 153 | 153 |
| 154 _PyImport_Init(); | 154 _PyImport_Init(); |
| 155 | 155 |
| 156 initsigs(); /* Signal handling stuff, including initintr() */ | 156 initsigs(); /* Signal handling stuff, including initintr() */ |
| 157 | 157 |
