# HG changeset patch # User Manuel Jacob # Date 1594368776 -7200 # Node ID b6afe1c5296451aa3aa633722a2457797078e9bb # Parent 29a905fe23aeb90519cf8ac300c69a0b0cac805a procutil: move comment closer to relevant code diff -r 29a905fe23ae -r b6afe1c52964 mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py Fri Jul 10 10:03:05 2020 +0200 +++ b/mercurial/utils/procutil.py Fri Jul 10 10:12:56 2020 +0200 @@ -91,9 +91,6 @@ stdout = sys.stdout stderr = sys.stderr -# glibc determines buffering on first write to stdout - if we replace a TTY -# destined stdout with a pipe destined stdout (e.g. pager), we want line -# buffering. if isatty(stdout): if pycompat.ispy3: # Python 3 implements its own I/O streams. @@ -106,6 +103,9 @@ # The Windows C runtime library doesn't support line buffering. stdout = make_line_buffered(stdout) else: + # glibc determines buffering on first write to stdout - if we + # replace a TTY destined stdout with a pipe destined stdout (e.g. + # pager), we want line buffering. stdout = os.fdopen(stdout.fileno(), 'wb', 1)