summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/import.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c
index 9ec8cd8..de5dc0c 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1908,6 +1908,10 @@ find_module_path_list(PyObject *fullname, PyObject *name,
fp = _Py_fopen(filename, filemode);
if (fp == NULL) {
Py_DECREF(filename);
+ if (PyErr_Occurred()) {
+ Py_DECREF(prefix);
+ return NULL;
+ }
continue;
}
match = case_ok(filename, -(Py_ssize_t)strlen(fdp->suffix), name);