diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/import.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c index beda7f97..e5581c5 100644 --- a/Python/import.c +++ b/Python/import.c @@ -3186,6 +3186,8 @@ call_find_module(char *name, PyObject *path) fd = dup(fd); fclose(fp); fp = NULL; + if (fd == -1) + return PyErr_SetFromErrno(PyExc_OSError); } if (fd != -1) { if (strchr(fdp->mode, 'b') == NULL) { |