Read about our upcoming Code of Conduct on this issue

Commit bd0de0d2 authored by Pulkit Goyal's avatar Pulkit Goyal
Browse files

procutil: don't assign stdin to None, use os.devnull instead

It will be painful to take care of procutil.stdin being None everywhere.

Thanks to Yuya who recommended it.
parent 49b6910217f9
......@@ -126,7 +126,11 @@ if pycompat.ispy3:
# a silly wrapper to make a bytes stream backed by a unicode one.
# sys.stdin can be None
stdin = sys.stdin.buffer if sys.stdin else sys.stdin
if sys.stdin:
stdin = sys.stdin.buffer
else:
stdin = open(os.devnull, 'rb')
os.close(stdin.fileno())
stdout = _make_write_all(sys.stdout.buffer)
stderr = _make_write_all(sys.stderr.buffer)
if pycompat.iswindows:
......
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