diff mercurial/ui.py @ 33865:af20468eb0a4

merge with stable
author Sean Farley <sean@farley.io>
date Mon, 21 Aug 2017 21:35:06 -0700
parents 7d5bc0e5b88f cde4cfeb6e3e
children 31a2eb0f74e5
line wrap: on
line diff
--- a/mercurial/ui.py	Fri Aug 11 01:34:11 2017 -0700
+++ b/mercurial/ui.py	Mon Aug 21 21:35:06 2017 -0700
@@ -904,7 +904,8 @@
                 if not getattr(self.ferr, 'closed', False):
                     self.ferr.flush()
         except IOError as inst:
-            raise error.StdioError(inst)
+            if inst.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
+                raise error.StdioError(inst)
 
     def flush(self):
         # opencode timeblockedsection because this is a critical path
@@ -913,12 +914,14 @@
             try:
                 self.fout.flush()
             except IOError as err:
-                raise error.StdioError(err)
+                if err.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
+                    raise error.StdioError(err)
             finally:
                 try:
                     self.ferr.flush()
                 except IOError as err:
-                    raise error.StdioError(err)
+                    if err.errno not in (errno.EPIPE, errno.EIO, errno.EBADF):
+                        raise error.StdioError(err)
         finally:
             self._blockedtimes['stdio_blocked'] += \
                 (util.timer() - starttime) * 1000