diff options
author | Collin Winter <collinw@gmail.com> | 2007-03-12 16:49:23 +0000 |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2007-03-12 16:49:23 +0000 |
commit | e19d7a3c0ac25680d2f72669f1441dadbb2f9a41 (patch) | |
tree | 85bd8be0b7673cd915fad4c782a5d3305062b77c /Python/pythonrun.c | |
parent | 1817f096f4153293abe7ffb6eda47be3f809fa77 (diff) | |
download | cpython-git-e19d7a3c0ac25680d2f72669f1441dadbb2f9a41.tar.gz |
Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167.
Backported from r54291.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 3b5307c7fb..75241fe915 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -193,6 +193,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 */ @@ -530,6 +533,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) { |