equal
deleted
inserted
replaced
34 |
34 |
35 # Import like this to keep import-checker happy |
35 # Import like this to keep import-checker happy |
36 from ..utils import resourceutil |
36 from ..utils import resourceutil |
37 |
37 |
38 osutil = policy.importmod('osutil') |
38 osutil = policy.importmod('osutil') |
39 |
|
40 stderr = pycompat.stderr |
|
41 stdin = pycompat.stdin |
|
42 stdout = pycompat.stdout |
|
43 |
39 |
44 |
40 |
45 def isatty(fp): |
41 def isatty(fp): |
46 try: |
42 try: |
47 return fp.isatty() |
43 return fp.isatty() |
76 return stream |
72 return stream |
77 if isinstance(stream, LineBufferedWrapper): |
73 if isinstance(stream, LineBufferedWrapper): |
78 return stream |
74 return stream |
79 return LineBufferedWrapper(stream) |
75 return LineBufferedWrapper(stream) |
80 |
76 |
|
77 |
|
78 stderr = pycompat.stderr |
|
79 stdin = pycompat.stdin |
|
80 stdout = pycompat.stdout |
81 |
81 |
82 # glibc determines buffering on first write to stdout - if we replace a TTY |
82 # glibc determines buffering on first write to stdout - if we replace a TTY |
83 # destined stdout with a pipe destined stdout (e.g. pager), we want line |
83 # destined stdout with a pipe destined stdout (e.g. pager), we want line |
84 # buffering (or unbuffered, on Windows) |
84 # buffering (or unbuffered, on Windows) |
85 if isatty(stdout): |
85 if isatty(stdout): |