Patchwork [06,of,11,V2] procutil: move comment closer to relevant code

login
register
mail settings
Submitter Manuel Jacob
Date July 12, 2020, 10:41 p.m.
Message ID <472cbd166fe075b8786d.1594593691@tmp>
Download mbox | patch
Permalink /patch/46710/
State Accepted
Headers show

Comments

Manuel Jacob - July 12, 2020, 10:41 p.m.
# HG changeset patch
# User Manuel Jacob <me@manueljacob.de>
# Date 1594368776 -7200
#      Fri Jul 10 10:12:56 2020 +0200
# Node ID 472cbd166fe075b8786d2965a44b4e5d1c26bdf5
# Parent  d439863e9340a845d2f1986ec45f40f38704e932
# EXP-Topic stdio
procutil: move comment closer to relevant code

Patch

diff --git a/mercurial/utils/procutil.py b/mercurial/utils/procutil.py
--- a/mercurial/utils/procutil.py
+++ b/mercurial/utils/procutil.py
@@ -112,9 +112,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.
@@ -127,6 +124,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 = reopen_stream(stdout, 'wb', 1)