]> granicus.if.org Git - python/commitdiff
In find_module(), do not silence fileno() and dup() errors.
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 22 Feb 2012 17:03:04 +0000 (18:03 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 22 Feb 2012 17:03:04 +0000 (18:03 +0100)
Python/import.c

index beda7f97d274b2f426cf19d3d0e7921ea352c173..e5581c5bba133c17610c73049d0303f3d93af8d9 100644 (file)
@@ -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) {