mirror of
https://github.com/python/cpython.git
synced 2025-07-28 05:34:31 +00:00
Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167.
Will backport.
This commit is contained in:
parent
f567ca3e1a
commit
276887b16d
7 changed files with 62 additions and 2 deletions
|
@ -194,6 +194,9 @@ Py_InitializeEx(int install_sigs)
|
|||
interp->modules = PyDict_New();
|
||||
if (interp->modules == NULL)
|
||||
Py_FatalError("Py_Initialize: can't make modules dictionary");
|
||||
interp->modules_reloading = PyDict_New();
|
||||
if (interp->modules_reloading == NULL)
|
||||
Py_FatalError("Py_Initialize: can't make modules_reloading dictionary");
|
||||
|
||||
#ifdef Py_USING_UNICODE
|
||||
/* Init Unicode implementation; relies on the codec registry */
|
||||
|
@ -531,6 +534,7 @@ Py_NewInterpreter(void)
|
|||
/* XXX The following is lax in error checking */
|
||||
|
||||
interp->modules = PyDict_New();
|
||||
interp->modules_reloading = PyDict_New();
|
||||
|
||||
bimod = _PyImport_FindExtension("__builtin__", "__builtin__");
|
||||
if (bimod != NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue