changeset 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 bf329bda51a6
children de081fbb27fe
files mercurial/ui.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Thu Jan 11 23:13:32 2007 +0100
+++ b/mercurial/ui.py	Wed Jan 10 20:35:27 2007 +0100
@@ -385,6 +385,9 @@
             if not sys.stdout.closed: sys.stdout.flush()
             for a in args:
                 sys.stderr.write(str(a))
+            # stderr may be buffered under win32 when redirected to files,
+            # including stdout.
+            if not sys.stderr.closed: sys.stderr.flush()
         except IOError, inst:
             if inst.errno != errno.EPIPE:
                 raise