ui: look before you leap on sys.stdout.closed
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Sun, 07 Feb 2010 16:44:55 +0100
changeset 10383 f83291e5643e
parent 10382 e54e3f6e6789
child 10384 832f35386067
ui: look before you leap on sys.stdout.closed
mercurial/ui.py
--- 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))