]> granicus.if.org Git - python/commitdiff
[Bug #620630] Flush stdout after logging every message. Without it,
authorAndrew M. Kuchling <amk@amk.ca>
Mon, 4 Nov 2002 14:27:43 +0000 (14:27 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Mon, 4 Nov 2002 14:27:43 +0000 (14:27 +0000)
   when output is redirected to a file, compiler error messages show
   up before Distutils prints the command being invoked.

Lib/distutils/log.py

index f0a7865067c4c4acd3387705485e1e1fec0d03ad..6aeb7c9aac5843591b47d4c2bd69f5015d8533a5 100644 (file)
@@ -9,6 +9,8 @@ WARN = 3
 ERROR = 4
 FATAL = 5
 
+import sys
+
 class Log:
 
     def __init__(self, threshold=WARN):
@@ -17,6 +19,7 @@ class Log:
     def _log(self, level, msg, args):
         if level >= self.threshold:
             print msg % args
+            sys.stdout.flush()
 
     def log(self, level, msg, *args):
         self._log(level, msg, args)