mercurial/utils/procutil.py
changeset 46083 81c1f5d1801f
parent 46030 2cf61e66c6d0
child 46102 7ce24d3761e8
--- a/mercurial/utils/procutil.py	Wed Dec 09 09:54:49 2020 -0800
+++ b/mercurial/utils/procutil.py	Wed Dec 02 13:55:17 2020 +0530
@@ -124,7 +124,9 @@
     # Python 3 implements its own I/O streams.
     # 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
+
+    # sys.stdin can be None
+    stdin = sys.stdin.buffer if sys.stdin else sys.stdin
     stdout = _make_write_all(sys.stdout.buffer)
     stderr = _make_write_all(sys.stderr.buffer)
     if pycompat.iswindows: