procutil: move comment closer to relevant code
authorManuel Jacob <me@manueljacob.de>
Fri, 10 Jul 2020 10:12:56 +0200
changeset 45082 b6afe1c52964
parent 45081 29a905fe23ae
child 45083 3a6ec080b521
procutil: move comment closer to relevant code
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)