Read about our upcoming Code of Conduct on this issue

Commit 5b667efa authored by Manuel Jacob's avatar Manuel Jacob
Browse files

procutil: make _make_write_all() function private

Because this function isn’t meant for general use (e.g., it’s Python 2-only),
make in a module-private function by prefixing it with `_`.
parent efcc87d37f4d
......@@ -100,7 +100,7 @@ class WriteAllWrapper(object):
io.IOBase.register(WriteAllWrapper)
def make_write_all(stream):
def _make_write_all(stream):
assert pycompat.ispy3
if isinstance(stream, WriteAllWrapper):
return stream
......@@ -118,11 +118,11 @@ if pycompat.ispy3:
# TODO: .buffer might not exist if std streams were replaced; we'll need
# a silly wrapper to make a bytes stream backed by a unicode one.
stdin = sys.stdin.buffer
stdout = make_write_all(sys.stdout.buffer)
stdout = _make_write_all(sys.stdout.buffer)
if isatty(stdout):
# The standard library doesn't offer line-buffered binary streams.
stdout = make_line_buffered(stdout)
stderr = make_write_all(sys.stderr.buffer)
stderr = _make_write_all(sys.stderr.buffer)
else:
# Python 2 uses the I/O streams provided by the C library.
stdin = sys.stdin
......
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