Issues #13959, 14647: Re-implement imp.reload() in Lib/imp.py.

Thanks to Eric Snow for the patch.
This commit is contained in:
Brett Cannon 2012-04-29 14:38:11 -04:00
parent 1fc3ec91cc
commit 62228dbd6c
6 changed files with 45 additions and 106 deletions

View file

@ -314,9 +314,6 @@ 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");
/* Init Unicode implementation; relies on the codec registry */
if (_PyUnicode_Init() < 0)
@ -680,7 +677,6 @@ Py_NewInterpreter(void)
/* XXX The following is lax in error checking */
interp->modules = PyDict_New();
interp->modules_reloading = PyDict_New();
bimod = _PyImport_FindBuiltin("builtins");
if (bimod != NULL) {