Fix issue #195. Redirect stdout/stderr to DEVNULL when quiet is requested.

This commit is contained in:
Tercio Gaudencio Filho 2020-09-15 22:08:51 -03:00
parent 4cb7d26f55
commit c12e8890ad
No known key found for this signature in database
GPG Key ID: EDF007606002A606

View File

@ -279,8 +279,10 @@ def run_async(
""" """
args = compile(stream_spec, cmd, overwrite_output=overwrite_output) args = compile(stream_spec, cmd, overwrite_output=overwrite_output)
stdin_stream = subprocess.PIPE if pipe_stdin else None stdin_stream = subprocess.PIPE if pipe_stdin else None
stdout_stream = subprocess.PIPE if pipe_stdout or quiet else None stdout_stream = subprocess.PIPE if pipe_stdout else None
stderr_stream = subprocess.PIPE if pipe_stderr or quiet else None stderr_stream = subprocess.PIPE if pipe_stderr else None
if quiet:
stdout_stream = stderr_stream = subprocess.DEVNULL
return subprocess.Popen( return subprocess.Popen(
args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream
) )