Kaydet (Commit) caaf53e7 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Issue #27419: Added temporary workaround for subinterpreters.

......@@ -1557,7 +1557,10 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
_PyImport_AcquireLock();
#endif
/* 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) {
PyErr_SetString(PyExc_ImportError, "__import__ not found");
goto error_with_unlock;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment