summaryrefslogtreecommitdiffstats
path: root/Python/importdl.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-08-02 03:10:38 (GMT)
committerGuido van Rossum <guido@python.org>1997-08-02 03:10:38 (GMT)
commit25ce566661c1b7446b3ddb4076513a62f93ce08d (patch)
tree39efd7dea3c5cf687c84ec4af49614b725755525 /Python/importdl.c
parent40b33c648a2d777636603356c12b644dd4c92876 (diff)
downloadcpython-25ce566661c1b7446b3ddb4076513a62f93ce08d.zip
cpython-25ce566661c1b7446b3ddb4076513a62f93ce08d.tar.gz
cpython-25ce566661c1b7446b3ddb4076513a62f93ce08d.tar.bz2
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.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/Python/importdl.c b/Python/importdl.c
index 44f57ac..b372e46 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 */