don't spin writer daemon when < /dev/null (#25170)
This commit is contained in:
parent
2dd2a5b167
commit
507d3c841c
@ -533,13 +533,15 @@ def __enter__(self):
|
|||||||
# Sets a daemon that writes to file what it reads from a pipe
|
# Sets a daemon that writes to file what it reads from a pipe
|
||||||
try:
|
try:
|
||||||
# need to pass this b/c multiprocessing closes stdin in child.
|
# need to pass this b/c multiprocessing closes stdin in child.
|
||||||
|
input_multiprocess_fd = None
|
||||||
try:
|
try:
|
||||||
|
if sys.stdin.isatty():
|
||||||
input_multiprocess_fd = MultiProcessFd(
|
input_multiprocess_fd = MultiProcessFd(
|
||||||
os.dup(sys.stdin.fileno())
|
os.dup(sys.stdin.fileno())
|
||||||
)
|
)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
# just don't forward input if this fails
|
# just don't forward input if this fails
|
||||||
input_multiprocess_fd = None
|
pass
|
||||||
|
|
||||||
with replace_environment(self.env):
|
with replace_environment(self.env):
|
||||||
self.process = multiprocessing.Process(
|
self.process = multiprocessing.Process(
|
||||||
|
Loading…
Reference in New Issue
Block a user