Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 4023:6ea8a3b805ee
Flush stderr after write.
stderr can be buffered under win32 when redirected to a file,
including stdout.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Wed, 10 Jan 2007 20:35:27 +0100 |
parents | e492ab235b4d |
children | 1bd6868b0b11 |
comparison
equal
deleted
inserted
replaced
4022:bf329bda51a6 | 4023:6ea8a3b805ee |
---|---|
383 def write_err(self, *args): | 383 def write_err(self, *args): |
384 try: | 384 try: |
385 if not sys.stdout.closed: sys.stdout.flush() | 385 if not sys.stdout.closed: sys.stdout.flush() |
386 for a in args: | 386 for a in args: |
387 sys.stderr.write(str(a)) | 387 sys.stderr.write(str(a)) |
388 # stderr may be buffered under win32 when redirected to files, | |
389 # including stdout. | |
390 if not sys.stderr.closed: sys.stderr.flush() | |
388 except IOError, inst: | 391 except IOError, inst: |
389 if inst.errno != errno.EPIPE: | 392 if inst.errno != errno.EPIPE: |
390 raise | 393 raise |
391 | 394 |
392 def flush(self): | 395 def flush(self): |