From e19d7a3c0ac25680d2f72669f1441dadbb2f9a41 Mon Sep 17 00:00:00 2001 From: Collin Winter Date: Mon, 12 Mar 2007 16:49:23 +0000 Subject: Bug #742342: make Python stop segfaulting on infinitely-recursive reload()s. Fixed by patch #922167. Backported from r54291. --- Python/pythonrun.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Python/pythonrun.c') 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) { -- cgit v1.2.1