mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #27419: Added temporary workaround for subinterpreters.
This commit is contained in:
commit
caaf53e748
1 changed files with 4 additions and 1 deletions
|
@ -1557,7 +1557,10 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
|
||||||
_PyImport_AcquireLock();
|
_PyImport_AcquireLock();
|
||||||
#endif
|
#endif
|
||||||
/* From this point forward, goto error_with_unlock! */
|
/* From this point forward, goto error_with_unlock! */
|
||||||
builtins_import = _PyDict_GetItemId(interp->builtins_copy, &PyId___import__);
|
/* XXX interp->builtins_copy is NULL in subinterpreter! */
|
||||||
|
builtins_import = _PyDict_GetItemId(interp->builtins_copy ?
|
||||||
|
interp->builtins_copy :
|
||||||
|
interp->builtins, &PyId___import__);
|
||||||
if (builtins_import == NULL) {
|
if (builtins_import == NULL) {
|
||||||
PyErr_SetString(PyExc_ImportError, "__import__ not found");
|
PyErr_SetString(PyExc_ImportError, "__import__ not found");
|
||||||
goto error_with_unlock;
|
goto error_with_unlock;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue