changeset 10383:f83291e5643e

ui: look before you leap on sys.stdout.closed
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Sun, 07 Feb 2010 16:44:55 +0100
parents e54e3f6e6789
children 832f35386067
files mercurial/ui.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/ui.py	Sun Feb 07 16:03:38 2010 +0100
+++ b/mercurial/ui.py	Sun Feb 07 16:44:55 2010 +0100
@@ -237,7 +237,7 @@
 
     def write_err(self, *args):
         try:
-            if not sys.stdout.closed:
+            if not hasattr(sys.stdout, 'closed') or not sys.stdout.closed:
                 sys.stdout.flush()
             for a in args:
                 sys.stderr.write(str(a))