stdout raises EINVAL when flush() is called on a closed pipe under win32.
authorPatrick Mezard <pmezard@gmail.com>
Mon, 19 Feb 2007 10:32:46 +0100
changeset 4129 e817c68edfed
parent 4128 43d8f7466920
child 4130 178007785be8
stdout raises EINVAL when flush() is called on a closed pipe under win32. Maybe the exception should be caught and translated at raise location instead (sshserver.py).
mercurial/util.py
--- a/mercurial/util.py	Mon Feb 19 10:29:05 2007 +0100
+++ b/mercurial/util.py	Mon Feb 19 10:32:46 2007 +0100
@@ -741,6 +741,14 @@
                 if inst.errno != 0: raise
                 self.close()
                 raise IOError(errno.EPIPE, 'Broken pipe')
+                
+        def flush(self):
+            try:
+                return self.fp.flush()
+            except IOError, inst:
+                if inst.errno != errno.EINVAL: raise
+                self.close()
+                raise IOError(errno.EPIPE, 'Broken pipe')
 
     sys.stdout = winstdout(sys.stdout)