windows: do not close stdout on flush() failure
authorYuya Nishihara <yuya@tcha.org>
Mon, 05 Jun 2017 23:36:35 +0900
changeset 32686 605f124d1146
parent 32685 8b2f735f0107
child 32687 12941a782928
windows: do not close stdout on flush() failure It's been there since e817c68edfed (2007-02-19), but seems wrong since any I/O operations to a closed file would raise ValueError, not IOError. We should keep the file object open even if the underlying file descriptor is half dead.
mercurial/windows.py
--- a/mercurial/windows.py	Mon Jun 05 23:23:03 2017 +0900
+++ b/mercurial/windows.py	Mon Jun 05 23:36:35 2017 +0900
@@ -180,7 +180,6 @@
         except IOError as inst:
             if inst.errno != errno.EINVAL:
                 raise
-            self.close()
             raise IOError(errno.EPIPE, 'Broken pipe')
 
 def _is_win_9x():