--- 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: