diff options
author | Guido van Rossum <guido@python.org> | 1997-08-02 03:10:38 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-08-02 03:10:38 +0000 |
commit | 170497e4e7ebbaabfa3dc4199e845ae800899195 (patch) | |
tree | 97287a57e7ca58465cd559d5d8c63ab28d154462 /Python/importdl.c | |
parent | e781f9bca8db6cb080b8e7f87089ad9c0d7ca08d (diff) | |
download | cpython-170497e4e7ebbaabfa3dc4199e845ae800899195.tar.gz |
The last of the mass checkins for separate (sub)interpreters.
Everything should now work again.
See the comments for the .h files mass checkin (e.g. pystate.h) for
more detail.
Diffstat (limited to 'Python/importdl.c')
-rw-r--r-- | Python/importdl.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Python/importdl.c b/Python/importdl.c index 44f57ac358..b372e46b59 100644 --- a/Python/importdl.c +++ b/Python/importdl.c @@ -246,6 +246,10 @@ _PyImport_LoadDynamicModule(name, pathname, fp) pathname = pathbuf; } #endif + if ((m = _PyImport_FindExtension(name, pathname)) != NULL) { + Py_INCREF(m); + return m; + } sprintf(funcname, FUNCNAME_PATTERN, name); #ifdef USE_SHLIB if (fp != NULL) { @@ -518,13 +522,15 @@ _PyImport_LoadDynamicModule(name, pathname, fp) return NULL; } (*p)(); - /* XXX Need check for err_occurred() here */ + if (PyErr_Occurred()) + return NULL; + if (_PyImport_FixupExtension(name, pathname) == NULL) + return NULL; m = PyDict_GetItemString(PyImport_GetModuleDict(), name); if (m == NULL) { - if (PyErr_Occurred() == NULL) - PyErr_SetString(PyExc_SystemError, - "dynamic module not initialized properly"); + PyErr_SetString(PyExc_SystemError, + "dynamic module not initialized properly"); return NULL; } /* Remember the filename as the __file__ attribute */ |