summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-06-20 13:16:55 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-06-20 13:16:55 (GMT)
commitd417d01ec80d9d13918fc90fd3ce0080232a8e7c (patch)
tree4eb19db5a52dd943510d349d8774e3498380b4c1
parent925ef39949b784d331dbb246b8888347ecd8b275 (diff)
downloadcpython-d417d01ec80d9d13918fc90fd3ce0080232a8e7c.zip
cpython-d417d01ec80d9d13918fc90fd3ce0080232a8e7c.tar.gz
cpython-d417d01ec80d9d13918fc90fd3ce0080232a8e7c.tar.bz2
call_find_module() handles dup() failure: raise an OSError exception
-rw-r--r--Python/import.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c
index de5dc0c..19e975a 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -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) {