call_find_module() handles dup() failure: raise an OSError exception

This commit is contained in:
Victor Stinner 2011-06-20 15:16:55 +02:00
parent 925ef39949
commit d417d01ec8

View File

@ -3567,6 +3567,10 @@ call_find_module(PyObject *name, PyObject *path_list)
if (fd != -1)
fd = dup(fd);
fclose(fp);
if (fd == -1) {
PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
fp = NULL;
}
if (fd != -1) {