mercurial/utils/procutil.py
changeset 46083 81c1f5d1801f
parent 46030 2cf61e66c6d0
child 46102 7ce24d3761e8
equal deleted inserted replaced
46082:c80f9e3daec3 46083:81c1f5d1801f
   122 
   122 
   123 if pycompat.ispy3:
   123 if pycompat.ispy3:
   124     # Python 3 implements its own I/O streams.
   124     # Python 3 implements its own I/O streams.
   125     # TODO: .buffer might not exist if std streams were replaced; we'll need
   125     # TODO: .buffer might not exist if std streams were replaced; we'll need
   126     # a silly wrapper to make a bytes stream backed by a unicode one.
   126     # a silly wrapper to make a bytes stream backed by a unicode one.
   127     stdin = sys.stdin.buffer
   127 
       
   128     # sys.stdin can be None
       
   129     stdin = sys.stdin.buffer if sys.stdin else sys.stdin
   128     stdout = _make_write_all(sys.stdout.buffer)
   130     stdout = _make_write_all(sys.stdout.buffer)
   129     stderr = _make_write_all(sys.stderr.buffer)
   131     stderr = _make_write_all(sys.stderr.buffer)
   130     if pycompat.iswindows:
   132     if pycompat.iswindows:
   131         # Work around Windows bugs.
   133         # Work around Windows bugs.
   132         stdout = platform.winstdout(stdout)
   134         stdout = platform.winstdout(stdout)