From 72146124432fd9372032de1a3a508236ea4ab0d4 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Wed, 22 Feb 2012 18:03:04 +0100 Subject: In find_module(), do not silence fileno() and dup() errors. --- Python/import.c | 2 ++ 1 file changed, 2 insertions(+) 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) { -- cgit v0.12