Patchwork [6,of,9] stdio: raise StdioError if something goes wrong in ui._write

login
register
mail settings
Submitter Bryan O'Sullivan
Date April 10, 2017, 6:51 p.m.
Message ID <5134460363aeaac3c50f.1491850296@bryano-mbp.local>
Download mbox | patch
Permalink /patch/20091/
State Changes Requested
Headers show

Comments

Bryan O'Sullivan - April 10, 2017, 6:51 p.m.
# HG changeset patch
# User Bryan O'Sullivan <bryano@fb.com>
# Date 1490915085 25200
#      Thu Mar 30 16:04:45 2017 -0700
# Node ID 5134460363aeaac3c50f982c611a113344923155
# Parent  024364c1aa2e8b247d6156208394ebf01913f85a
stdio: raise StdioError if something goes wrong in ui._write

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -765,6 +765,8 @@  class ui(object):
         try:
             for a in msgs:
                 self.fout.write(a)
+        except IOError as err:
+            error.raisestdio(err)
         finally:
             self._blockedtimes['stdio_blocked'] += \
                 (util.timer() - starttime) * 1000