comparison Python/pythonrun.c @ 41128:45ce388ec59a legacy-trunk

Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167. Will backport.
author Collin Winter <collinw@gmail.com>
date Mon, 12 Mar 2007 16:11:39 +0000
parents a87bcc37bf0f
children 708c8c5fc173
comparison
equal deleted inserted replaced
41127:7100c59182ff 41128:45ce388ec59a
192 _PyFloat_Init(); 192 _PyFloat_Init();
193 193
194 interp->modules = PyDict_New(); 194 interp->modules = PyDict_New();
195 if (interp->modules == NULL) 195 if (interp->modules == NULL)
196 Py_FatalError("Py_Initialize: can't make modules dictionary"); 196 Py_FatalError("Py_Initialize: can't make modules dictionary");
197 interp->modules_reloading = PyDict_New();
198 if (interp->modules_reloading == NULL)
199 Py_FatalError("Py_Initialize: can't make modules_reloading dictionary");
197 200
198 #ifdef Py_USING_UNICODE 201 #ifdef Py_USING_UNICODE
199 /* Init Unicode implementation; relies on the codec registry */ 202 /* Init Unicode implementation; relies on the codec registry */
200 _PyUnicode_Init(); 203 _PyUnicode_Init();
201 #endif 204 #endif
529 save_tstate = PyThreadState_Swap(tstate); 532 save_tstate = PyThreadState_Swap(tstate);
530 533
531 /* XXX The following is lax in error checking */ 534 /* XXX The following is lax in error checking */
532 535
533 interp->modules = PyDict_New(); 536 interp->modules = PyDict_New();
537 interp->modules_reloading = PyDict_New();
534 538
535 bimod = _PyImport_FindExtension("__builtin__", "__builtin__"); 539 bimod = _PyImport_FindExtension("__builtin__", "__builtin__");
536 if (bimod != NULL) { 540 if (bimod != NULL) {
537 interp->builtins = PyModule_GetDict(bimod); 541 interp->builtins = PyModule_GetDict(bimod);
538 if (interp->builtins == NULL) 542 if (interp->builtins == NULL)