Show More
@@ -100,7 +100,7 b' class WriteAllWrapper(object):' | |||||
100 | io.IOBase.register(WriteAllWrapper) |
|
100 | io.IOBase.register(WriteAllWrapper) | |
101 |
|
101 | |||
102 |
|
102 | |||
103 | def make_write_all(stream): |
|
103 | def _make_write_all(stream): | |
104 | assert pycompat.ispy3 |
|
104 | assert pycompat.ispy3 | |
105 | if isinstance(stream, WriteAllWrapper): |
|
105 | if isinstance(stream, WriteAllWrapper): | |
106 | return stream |
|
106 | return stream | |
@@ -118,11 +118,11 b' if pycompat.ispy3:' | |||||
118 | # TODO: .buffer might not exist if std streams were replaced; we'll need |
|
118 | # TODO: .buffer might not exist if std streams were replaced; we'll need | |
119 | # a silly wrapper to make a bytes stream backed by a unicode one. |
|
119 | # a silly wrapper to make a bytes stream backed by a unicode one. | |
120 | stdin = sys.stdin.buffer |
|
120 | stdin = sys.stdin.buffer | |
121 | stdout = make_write_all(sys.stdout.buffer) |
|
121 | stdout = _make_write_all(sys.stdout.buffer) | |
122 | if isatty(stdout): |
|
122 | if isatty(stdout): | |
123 | # The standard library doesn't offer line-buffered binary streams. |
|
123 | # The standard library doesn't offer line-buffered binary streams. | |
124 | stdout = make_line_buffered(stdout) |
|
124 | stdout = make_line_buffered(stdout) | |
125 | stderr = make_write_all(sys.stderr.buffer) |
|
125 | stderr = _make_write_all(sys.stderr.buffer) | |
126 | else: |
|
126 | else: | |
127 | # Python 2 uses the I/O streams provided by the C library. |
|
127 | # Python 2 uses the I/O streams provided by the C library. | |
128 | stdin = sys.stdin |
|
128 | stdin = sys.stdin |
General Comments 0
You need to be logged in to leave comments.
Login now