summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 8773be4..805cdd7 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1403,7 +1403,8 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
if (builtins_import == NULL) {
builtins_import = _PyDict_GetItemId(interp->builtins, &PyId___import__);
if (builtins_import == NULL) {
- Py_FatalError("__import__ missing");
+ PyErr_SetString(PyExc_ImportError, "__import__ not found");
+ goto error_with_unlock;
}
}
Py_INCREF(builtins_import);