Read about our upcoming Code of Conduct on this issue

Commit e071faa4 authored by Manuel Jacob's avatar Manuel Jacob
Browse files

procutil: move assignments closer to reassignments

Doing reassignments is an anti-pattern IMHO, but I see how it makes sense here.
When first looking at this code after jumping here with ctags, I missed the
fact that stdout was reassigned. To make the code clearer, the assignments
should be as close as possible to the reassignments.
parent fd205a9c358a
......@@ -37,10 +37,6 @@ from ..utils import resourceutil
osutil = policy.importmod('osutil')
stderr = pycompat.stderr
stdin = pycompat.stdin
stdout = pycompat.stdout
def isatty(fp):
......@@ -79,6 +75,10 @@ def make_line_buffered(stream):
return LineBufferedWrapper(stream)
stderr = pycompat.stderr
stdin = pycompat.stdin
stdout = pycompat.stdout
# 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 (or unbuffered, on Windows)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment