# HG changeset patch # User Manuel Jacob # Date 1594446424 -7200 # Node ID b4c35e439ea5b1f2ac411c1a30dee6ac06be2320 # Parent 63196198dbf0871f509155efec43b98f39b50a4c procutil: move assignments This should probably be part of the previous patch, but folding it results in a less useful word diff, so I decided to keep it separate for review. diff -r 63196198dbf0 -r b4c35e439ea5 mercurial/utils/procutil.py --- a/mercurial/utils/procutil.py Fri Jul 10 10:12:04 2020 +0200 +++ b/mercurial/utils/procutil.py Sat Jul 11 07:47:04 2020 +0200 @@ -86,15 +86,14 @@ # a silly wrapper to make a bytes stream backed by a unicode one. stdin = sys.stdin.buffer stdout = sys.stdout.buffer - stderr = sys.stderr.buffer if isatty(stdout): # The standard library doesn't offer line-buffered binary streams. stdout = make_line_buffered(stdout) + stderr = sys.stderr.buffer else: # Python 2 uses the I/O streams provided by the C library. stdin = sys.stdin stdout = sys.stdout - stderr = sys.stderr if isatty(stdout): if pycompat.iswindows: # Work around size limit when writing to console. @@ -106,6 +105,7 @@ # replace a TTY destined stdout with a pipe destined stdout (e.g. # pager), we want line buffering. stdout = os.fdopen(stdout.fileno(), 'wb', 1) + stderr = sys.stderr findexe = platform.findexe