From: Antoine Pitrou Date: Wed, 22 Feb 2012 17:03:04 +0000 (+0100) Subject: In find_module(), do not silence fileno() and dup() errors. X-Git-Tag: v3.2.3rc1~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=72146124432fd9372032de1a3a508236ea4ab0d4;p=thirdparty%2FPython%2Fcpython.git In find_module(), do not silence fileno() and dup() errors. --- diff --git a/Python/import.c b/Python/import.c index beda7f97d274..e5581c5bba13 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) {