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

login
register
mail settings
Submitter Bryan O'Sullivan
Date April 14, 2017, 4:29 a.m.
Message ID <e2a4bc13996100c5409f.1492144184@jsdf-mbp.dhcp.thefacebook.com>
Download mbox | patch
Permalink /patch/20189/
State Accepted
Headers show

Comments

Bryan O'Sullivan - April 14, 2017, 4:29 a.m.
# HG changeset patch
# User Bryan O'Sullivan <bryano@fb.com>
# Date 1491947652 25200
#      Tue Apr 11 14:54:12 2017 -0700
# Node ID e2a4bc13996100c5409f2e8561143e9fdad758a9
# Parent  942022da49166766fe4a7967b71411879221c197
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
@@ -768,6 +768,8 @@  class ui(object):
         try:
             for a in msgs:
                 self.fout.write(a)
+        except IOError as err:
+            raise error.StdioError(err)
         finally:
             self._blockedtimes['stdio_blocked'] += \
                 (util.timer() - starttime) * 1000