summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-03-12 16:11:39 (GMT)
committerCollin Winter <collinw@gmail.com>2007-03-12 16:11:39 (GMT)
commit276887b16dc86e3423760c6ed9353591708fba17 (patch)
tree04e9896ffc00c0291959b4be71a83273e790b4ad /Python/pythonrun.c
parentf567ca3e1ae851ea6e7418da3df47e034841a08d (diff)
downloadcpython-276887b16dc86e3423760c6ed9353591708fba17.zip
cpython-276887b16dc86e3423760c6ed9353591708fba17.tar.gz
cpython-276887b16dc86e3423760c6ed9353591708fba17.tar.bz2
Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167.
Will backport.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 3a9e75e..3e5ecfe 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -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) {