shell_command: enable stderr if a callback is set
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
15890b9e87
commit
d20631e69f
|
@ -161,8 +161,10 @@ class ShellCommand:
|
||||||
return asyncio.subprocess.SubprocessStreamProtocol(
|
return asyncio.subprocess.SubprocessStreamProtocol(
|
||||||
limit=2**20, loop=loop)
|
limit=2**20, loop=loop)
|
||||||
try:
|
try:
|
||||||
errpipe = asyncio.subprocess.PIPE if self.log_stderr \
|
if self.std_err_cb is not None or self.log_stderr:
|
||||||
else asyncio.subprocess.STDOUT
|
errpipe = asyncio.subprocess.PIPE
|
||||||
|
else:
|
||||||
|
errpipe = asyncio.subprocess.STDOUT
|
||||||
transport, protocol = await loop.subprocess_exec(
|
transport, protocol = await loop.subprocess_exec(
|
||||||
protocol_factory, *self.command,
|
protocol_factory, *self.command,
|
||||||
stdout=asyncio.subprocess.PIPE,
|
stdout=asyncio.subprocess.PIPE,
|
||||||
|
|
Loading…
Reference in New Issue