Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 41131:66f265ac4ec4 2.5
Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167.
Backported from r54291.
| author | Collin Winter <collinw@gmail.com> |
|---|---|
| date | Mon, 12 Mar 2007 16:49:23 +0000 |
| parents | 1080de49c81e |
| children | a3bf55a03f66 |
comparison
equal
deleted
inserted
replaced
| 41130:5be3d2177340 | 41131:66f265ac4ec4 |
|---|---|
| 191 _PyFloat_Init(); | 191 _PyFloat_Init(); |
| 192 | 192 |
| 193 interp->modules = PyDict_New(); | 193 interp->modules = PyDict_New(); |
| 194 if (interp->modules == NULL) | 194 if (interp->modules == NULL) |
| 195 Py_FatalError("Py_Initialize: can't make modules dictionary"); | 195 Py_FatalError("Py_Initialize: can't make modules dictionary"); |
| 196 interp->modules_reloading = PyDict_New(); | |
| 197 if (interp->modules_reloading == NULL) | |
| 198 Py_FatalError("Py_Initialize: can't make modules_reloading dictionary"); | |
| 196 | 199 |
| 197 #ifdef Py_USING_UNICODE | 200 #ifdef Py_USING_UNICODE |
| 198 /* Init Unicode implementation; relies on the codec registry */ | 201 /* Init Unicode implementation; relies on the codec registry */ |
| 199 _PyUnicode_Init(); | 202 _PyUnicode_Init(); |
| 200 #endif | 203 #endif |
| 528 save_tstate = PyThreadState_Swap(tstate); | 531 save_tstate = PyThreadState_Swap(tstate); |
| 529 | 532 |
| 530 /* XXX The following is lax in error checking */ | 533 /* XXX The following is lax in error checking */ |
| 531 | 534 |
| 532 interp->modules = PyDict_New(); | 535 interp->modules = PyDict_New(); |
| 536 interp->modules_reloading = PyDict_New(); | |
| 533 | 537 |
| 534 bimod = _PyImport_FindExtension("__builtin__", "__builtin__"); | 538 bimod = _PyImport_FindExtension("__builtin__", "__builtin__"); |
| 535 if (bimod != NULL) { | 539 if (bimod != NULL) { |
| 536 interp->builtins = PyModule_GetDict(bimod); | 540 interp->builtins = PyModule_GetDict(bimod); |
| 537 if (interp->builtins == NULL) | 541 if (interp->builtins == NULL) |
