# HG changeset patch # User Patrick Mezard # Date 2007-02-19 09:32:46 # Node ID e817c68edfed97d3005ce38d03f365fb37a8fc01 # Parent 43d8f7466920a975aad438ff4481283f3d044cdc 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). diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -741,6 +741,14 @@ if os.name == 'nt': 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)