diff Python/import.c @ 75175:963a0fba98e0 3.2

In find_module(), do not silence fileno() and dup() errors.
author Antoine Pitrou <solipsis@pitrou.net>
date Wed, 22 Feb 2012 18:03:04 +0100
parents c79d0a7ac79d
children cbfd2bf80db0
line wrap: on
line diff
--- a/Python/import.c	Wed Feb 22 11:46:41 2012 +0200
+++ b/Python/import.c	Wed Feb 22 18:03:04 2012 +0100
@@ -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) {