diff options
author | Collin Winter <collinw@gmail.com> | 2007-03-13 23:02:15 (GMT) |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2007-03-13 23:02:15 (GMT) |
commit | 47c52a8b60444e4f0aae9c0e91794d214b68bd45 (patch) | |
tree | 814065e1c0f6f6891872b5dd1caf46f891b958d6 /Python | |
parent | 4aef7275cb993e18cdddf8ae8615d44f757fd717 (diff) | |
download | cpython-47c52a8b60444e4f0aae9c0e91794d214b68bd45.zip cpython-47c52a8b60444e4f0aae9c0e91794d214b68bd45.tar.gz cpython-47c52a8b60444e4f0aae9c0e91794d214b68bd45.tar.bz2 |
Inline PyImport_GetModulesReloading().
Diffstat (limited to 'Python')
-rw-r--r-- | Python/import.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Python/import.c b/Python/import.c index 365f978..9151762 100644 --- a/Python/import.c +++ b/Python/import.c @@ -340,16 +340,6 @@ imp_release_lock(PyObject *self, PyObject *noargs) return Py_None; } -PyObject * -PyImport_GetModulesReloading(void) -{ - PyInterpreterState *interp = PyThreadState_Get()->interp; - if (interp->modules_reloading == NULL) - Py_FatalError("PyImport_GetModulesReloading: " - "no modules_reloading dictionary!"); - return interp->modules_reloading; -} - static void imp_modules_reloading_clear(void) { @@ -2420,7 +2410,8 @@ import_submodule(PyObject *mod, char *subname, char *fullname) PyObject * PyImport_ReloadModule(PyObject *m) { - PyObject *modules_reloading = PyImport_GetModulesReloading(); + PyInterpreterState *interp = PyThreadState_Get()->interp; + PyObject *modules_reloading = interp->modules_reloading; PyObject *modules = PyImport_GetModuleDict(); PyObject *path = NULL, *loader = NULL, *existing_m = NULL; char *name, *subname; @@ -2428,6 +2419,12 @@ PyImport_ReloadModule(PyObject *m) struct filedescr *fdp; FILE *fp = NULL; PyObject *newm; + + if (modules_reloading == NULL) { + Py_FatalError("PyImport_ReloadModule: " + "no modules_reloading dictionary!"); + return NULL; + } if (m == NULL || !PyModule_Check(m)) { PyErr_SetString(PyExc_TypeError, |