Mercurial > cpython-lru_cache-weakref
diff Python/importdl.c @ 5926:8d2194e22e67 legacy-trunk
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.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Sat, 02 Aug 1997 03:10:38 +0000 |
| parents | e2df95b7be78 |
| children | 0eb14a6484f3 |
line wrap: on
line diff
--- a/Python/importdl.c Sat Aug 02 03:07:46 1997 +0000 +++ b/Python/importdl.c Sat Aug 02 03:10:38 1997 +0000 @@ -246,6 +246,10 @@ 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 @@ 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 */
