Flushes the output buffer after each echo
authorFrederic Massart <fred@moodle.com>
Mon, 6 Aug 2012 07:55:49 +0000 (15:55 +0800)
committerFrederic Massart <fred@moodle.com>
Mon, 6 Aug 2012 07:55:49 +0000 (15:55 +0800)
lib/tools.py

index 2db224b..7c3ede4 100644 (file)
@@ -3,6 +3,7 @@
 
 import shlex
 import subprocess
+import sys
 
 def yesOrNo(q):
        answers = ['y', 'n']
@@ -15,6 +16,7 @@ def yesOrNo(q):
 
 def debug(str):
        print str
+       sys.stdout.flush()
 
 def process(cmd, cwd=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE):
        if type(cmd) != 'list':