Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 76640:eb68502731dd
Issues #13959, 14647: Re-implement imp.reload() in Lib/imp.py.
Thanks to Eric Snow for the patch.
| author | Brett Cannon <brett@python.org> |
|---|---|
| date | Sun, 29 Apr 2012 14:38:11 -0400 |
| parents | 57d558f1904d |
| children | b0eb7d2a9542 |
comparison
equal
deleted
inserted
replaced
| 76637:1255cac63dfc | 76640:eb68502731dd |
|---|---|
| 312 _PyFloat_Init(); | 312 _PyFloat_Init(); |
| 313 | 313 |
| 314 interp->modules = PyDict_New(); | 314 interp->modules = PyDict_New(); |
| 315 if (interp->modules == NULL) | 315 if (interp->modules == NULL) |
| 316 Py_FatalError("Py_Initialize: can't make modules dictionary"); | 316 Py_FatalError("Py_Initialize: can't make modules dictionary"); |
| 317 interp->modules_reloading = PyDict_New(); | |
| 318 if (interp->modules_reloading == NULL) | |
| 319 Py_FatalError("Py_Initialize: can't make modules_reloading dictionary"); | |
| 320 | 317 |
| 321 /* Init Unicode implementation; relies on the codec registry */ | 318 /* Init Unicode implementation; relies on the codec registry */ |
| 322 if (_PyUnicode_Init() < 0) | 319 if (_PyUnicode_Init() < 0) |
| 323 Py_FatalError("Py_Initialize: can't initialize unicode"); | 320 Py_FatalError("Py_Initialize: can't initialize unicode"); |
| 324 | 321 |
| 678 save_tstate = PyThreadState_Swap(tstate); | 675 save_tstate = PyThreadState_Swap(tstate); |
| 679 | 676 |
| 680 /* XXX The following is lax in error checking */ | 677 /* XXX The following is lax in error checking */ |
| 681 | 678 |
| 682 interp->modules = PyDict_New(); | 679 interp->modules = PyDict_New(); |
| 683 interp->modules_reloading = PyDict_New(); | |
| 684 | 680 |
| 685 bimod = _PyImport_FindBuiltin("builtins"); | 681 bimod = _PyImport_FindBuiltin("builtins"); |
| 686 if (bimod != NULL) { | 682 if (bimod != NULL) { |
| 687 interp->builtins = PyModule_GetDict(bimod); | 683 interp->builtins = PyModule_GetDict(bimod); |
| 688 if (interp->builtins == NULL) | 684 if (interp->builtins == NULL) |
