summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 3e27715..44aae80 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1366,6 +1366,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
PyObject *globals = NULL;
PyObject *fromlist = NULL;
PyInterpreterState *interp = PyThreadState_GET()->interp;
+ int has_from;
/* Make sure to use default values so as to not have
PyObject_CallMethodObjArgs() truncate the parameter list because of a
@@ -1596,7 +1597,10 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
}
/* From now on we don't hold the import lock anymore. */
- if (PyObject_Not(fromlist)) {
+ has_from = PyObject_IsTrue(fromlist);
+ if (has_from < 0)
+ goto error;
+ if (!has_from) {
if (level == 0 || PyUnicode_GET_LENGTH(name) > 0) {
PyObject *front = NULL;
PyObject *partition = NULL;