Mercurial > cpython-lru_cache-weakref
diff 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 |
line wrap: on
line diff
--- a/Python/pythonrun.c Mon Mar 12 15:57:19 2007 +0000 +++ b/Python/pythonrun.c Mon Mar 12 16:11:39 2007 +0000 @@ -194,6 +194,9 @@ 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 @@ /* 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) {
