diff options
author | Collin Winter <collinw@gmail.com> | 2007-03-13 23:04:29 +0000 |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2007-03-13 23:04:29 +0000 |
commit | 2a98ff8eedda81a222b9df63cc29a91ca23cfb54 (patch) | |
tree | bc47801c53d765a3161b194fe3c946b1e9085b63 | |
parent | afa4f485dd43b1c6555abc34505d20deb6aed141 (diff) | |
download | cpython-git-2a98ff8eedda81a222b9df63cc29a91ca23cfb54.tar.gz |
Inline PyImport_GetModulesReloading(). Backport from r54368.
-rw-r--r-- | Python/import.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Python/import.c b/Python/import.c index b62eeef768..291e63dc79 100644 --- a/Python/import.c +++ b/Python/import.c @@ -339,15 +339,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_GetModuleDict: no modules_reloading dictionary!"); - return interp->modules_reloading; -} - static void imp_modules_reloading_clear (void) { @@ -2420,7 +2411,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 +2420,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, |