summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-02-22 17:03:04 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-02-22 17:03:04 (GMT)
commit72146124432fd9372032de1a3a508236ea4ab0d4 (patch)
tree60f895f534a61be8d3b15d124aa4341b36344961
parent9f64f731933bfebf6767a42a0ae75503c1936454 (diff)
downloadcpython-72146124432fd9372032de1a3a508236ea4ab0d4.zip
cpython-72146124432fd9372032de1a3a508236ea4ab0d4.tar.gz
cpython-72146124432fd9372032de1a3a508236ea4ab0d4.tar.bz2
In find_module(), do not silence fileno() and dup() errors.
-rw-r--r--Python/import.c2
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) {