diff -r e9646ff34d55 -r 1bfb9a63b98e mercurial/ui.py --- a/mercurial/ui.py Tue Apr 11 14:54:12 2017 -0700 +++ b/mercurial/ui.py Tue Apr 11 14:54:12 2017 -0700 @@ -807,10 +807,15 @@ # opencode timeblockedsection because this is a critical path starttime = util.timer() try: - try: self.fout.flush() - except (IOError, ValueError): pass - try: self.ferr.flush() - except (IOError, ValueError): pass + try: + self.fout.flush() + except IOError as err: + raise error.StdioError(err) + finally: + try: + self.ferr.flush() + except IOError as err: + raise error.StdioError(err) finally: self._blockedtimes['stdio_blocked'] += \ (util.timer() - starttime) * 1000