In find_module(), do not silence fileno() and dup() errors.

This commit is contained in:
Antoine Pitrou 2012-02-22 18:03:04 +01:00
parent 9f64f73193
commit 7214612443
1 changed files with 2 additions and 0 deletions

View File

@ -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) {