summaryrefslogtreecommitdiffstats
path: root/repo
diff options
context:
space:
mode:
authorSebastian Schuberth <sschuberth@gmail.com>2018-07-13 11:47:10 +0200
committerSebastian Schuberth <sschuberth@gmail.com>2018-07-13 16:23:50 +0200
commita9399846faa077a8eb15aedb8b498cba7cf3aeba (patch)
tree089048ac29d73f4984d13133ab5de7099b04d27b /repo
parentb10f0e5b9a9ba6d8e9a27b3a81d2fc1d65d9810d (diff)
downloadgit-repo-a9399846faa077a8eb15aedb8b498cba7cf3aeba.tar.gz
Flush stderr on Windows
While on Linux stderr is unbuffered, it is buffered on Windows. Always flush stderr on Windows to ensure any error messages appear in the right order to ease diagnosing. Change-Id: I37300e384ecd3a51a321a48818f0114d6f3357a0
Diffstat (limited to 'repo')
-rwxr-xr-xrepo4
1 files changed, 4 insertions, 0 deletions
diff --git a/repo b/repo
index 13ccd2ba..3ae38360 100755
--- a/repo
+++ b/repo
@@ -144,6 +144,10 @@ def _print(*objects, **kwargs):
144 out = kwargs.get('file', sys.stdout) 144 out = kwargs.get('file', sys.stdout)
145 out.write(sep.join(objects) + end) 145 out.write(sep.join(objects) + end)
146 146
147 # On Windows stderr is buffered, so flush to maintain the order of error messages.
148 if out == sys.stderr and platform.system() == "Windows":
149 out.flush()
150
147 151
148# Python version check 152# Python version check
149ver = sys.version_info 153ver = sys.version_info