diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-02-22 17:03:04 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-02-22 17:03:04 (GMT) |
commit | 72146124432fd9372032de1a3a508236ea4ab0d4 (patch) | |
tree | 60f895f534a61be8d3b15d124aa4341b36344961 /Python/import.c | |
parent | 9f64f731933bfebf6767a42a0ae75503c1936454 (diff) | |
download | cpython-72146124432fd9372032de1a3a508236ea4ab0d4.zip cpython-72146124432fd9372032de1a3a508236ea4ab0d4.tar.gz cpython-72146124432fd9372032de1a3a508236ea4ab0d4.tar.bz2 |
In find_module(), do not silence fileno() and dup() errors.
Diffstat (limited to 'Python/import.c')
-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) { |