changeset 45081:00cdac669614

procutil: split if condition This prepares the code for subsequent changes where we need to differentiate between the two cases.
author Manuel Jacob <me@manueljacob.de>
date Fri, 10 Jul 2020 09:59:36 +0200
parents 8628cd1122d2
children 29a905fe23ae
files mercurial/utils/procutil.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/utils/procutil.py	Fri Jul 10 09:55:38 2020 +0200
+++ b/mercurial/utils/procutil.py	Fri Jul 10 09:59:36 2020 +0200
@@ -98,9 +98,11 @@
 # destined stdout with a pipe destined stdout (e.g. pager), we want line
 # buffering.
 if isatty(stdout):
-    if pycompat.ispy3 or pycompat.iswindows:
+    if pycompat.ispy3:
         # Python 3 implements its own I/O streams.
         # The standard library doesn't offer line-buffered binary streams.
+        stdout = make_line_buffered(stdout)
+    elif pycompat.iswindows:
         # Python 2 uses the I/O streams provided by the C library.
         # The Windows C runtime library doesn't support line buffering.
         stdout = make_line_buffered(stdout)