summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2002-11-04 14:27:43 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2002-11-04 14:27:43 (GMT)
commite2d1214c42a4fb4a931c17dc07e11b02816528ff (patch)
tree5b382aa6892474a4bdc68e5e5b9415bf73c787d9
parent33a5edf89c566383be3b8825bb68dedbf56380a0 (diff)
downloadcpython-e2d1214c42a4fb4a931c17dc07e11b02816528ff.zip
cpython-e2d1214c42a4fb4a931c17dc07e11b02816528ff.tar.gz
cpython-e2d1214c42a4fb4a931c17dc07e11b02816528ff.tar.bz2
[Bug #620630] Flush stdout after logging every message. Without it,
when output is redirected to a file, compiler error messages show up before Distutils prints the command being invoked.
-rw-r--r--Lib/distutils/log.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/distutils/log.py b/Lib/distutils/log.py
index f0a7865..6aeb7c9 100644
--- a/Lib/distutils/log.py
+++ b/Lib/distutils/log.py
@@ -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)