]> granicus.if.org Git - python/commitdiff
http://bugs.python.org/issue5544
authorKristján Valur Jónsson <kristjan@ccpgames.com>
Tue, 24 Mar 2009 13:51:36 +0000 (13:51 +0000)
committerKristján Valur Jónsson <kristjan@ccpgames.com>
Tue, 24 Mar 2009 13:51:36 +0000 (13:51 +0000)
Fix to the last checkin, correctly raise an exception on failure.

Modules/_fileio.c

index 00065611e381c5a49954c6ed5f321ef7e6bdc4e1..cc1cbeff5d7ce9c2afac9e361dfe04f1f4e460b0 100644 (file)
@@ -84,8 +84,10 @@ internal_close(PyFileIOObject *self)
                        if (err < 0)
                                save_errno = errno;
                        Py_END_ALLOW_THREADS
-               } else
-               save_errno = errno;
+               } else {
+                       save_errno = errno;
+                       err = -1;
+               }
        }
        if (err < 0) {
                errno = save_errno;