Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 1989:0541768fa558
ignore EPIPE in ui.err_write
It avoids not being able to abort a transaction when a push via ssh fails.
Maybe some other place should ignore EPIPE too.
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Thu, 23 Mar 2006 23:16:41 +0100 |
parents | c577689006fa |
children | 62647394e368 |
comparison
equal
deleted
inserted
replaced
1988:18a3e6369600 | 1989:0541768fa558 |
---|---|
6 # of the GNU General Public License, incorporated herein by reference. | 6 # of the GNU General Public License, incorporated herein by reference. |
7 | 7 |
8 import ConfigParser | 8 import ConfigParser |
9 from i18n import gettext as _ | 9 from i18n import gettext as _ |
10 from demandload import * | 10 from demandload import * |
11 demandload(globals(), "os re socket sys util tempfile") | 11 demandload(globals(), "errno os re socket sys tempfile util") |
12 | 12 |
13 class ui(object): | 13 class ui(object): |
14 def __init__(self, verbose=False, debug=False, quiet=False, | 14 def __init__(self, verbose=False, debug=False, quiet=False, |
15 interactive=True, parentui=None): | 15 interactive=True, parentui=None): |
16 self.overlay = {} | 16 self.overlay = {} |
177 def write(self, *args): | 177 def write(self, *args): |
178 for a in args: | 178 for a in args: |
179 sys.stdout.write(str(a)) | 179 sys.stdout.write(str(a)) |
180 | 180 |
181 def write_err(self, *args): | 181 def write_err(self, *args): |
182 if not sys.stdout.closed: sys.stdout.flush() | 182 try: |
183 for a in args: | 183 if not sys.stdout.closed: sys.stdout.flush() |
184 sys.stderr.write(str(a)) | 184 for a in args: |
185 sys.stderr.write(str(a)) | |
186 except IOError, inst: | |
187 if inst.errno != errno.EPIPE: | |
188 raise | |
185 | 189 |
186 def flush(self): | 190 def flush(self): |
187 try: | 191 try: |
188 sys.stdout.flush() | 192 sys.stdout.flush() |
189 finally: | 193 finally: |