[Python-checkins] cpython (3.2): In find_module(), do not silence fileno() and dup() errors.
antoine.pitrou
python-checkins at python.org
Wed Feb 22 18:12:03 CET 2012
http://hg.python.org/cpython/rev/963a0fba98e0
changeset: 75175:963a0fba98e0
branch: 3.2
parent: 75168:fc5de19c66e2
user: Antoine Pitrou <solipsis at pitrou.net>
date: Wed Feb 22 18:03:04 2012 +0100
summary:
In find_module(), do not silence fileno() and dup() errors.
files:
Python/import.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/Python/import.c b/Python/import.c
--- a/Python/import.c
+++ b/Python/import.c
@@ -3186,6 +3186,8 @@
fd = dup(fd);
fclose(fp);
fp = NULL;
+ if (fd == -1)
+ return PyErr_SetFromErrno(PyExc_OSError);
}
if (fd != -1) {
if (strchr(fdp->mode, 'b') == NULL) {
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list