Skip to content

Commit 55340d4

Browse files
committed
core: Capture stderr in CLIDriver even if capture_output is False
We need to capture stderr to print the error when the driver fails.
1 parent 06b7308 commit 55340d4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

alectryon/core.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,9 @@ def run_cli(self, working_directory=None, capture_output=True, more_args=()):
488488
*self.CLI_ARGS, *self.user_args, *more_args]
489489
self._debug_start(cmd)
490490
p = subprocess.run(cmd, cwd=working_directory,
491-
capture_output=capture_output, check=False,
492-
encoding=self.CLI_ENCODING)
491+
stderr=subprocess.PIPE,
492+
stdout=subprocess.PIPE if capture_output else None,
493+
check=False, encoding=self.CLI_ENCODING)
493494
if p.returncode != 0:
494495
MSG = "Driver {} ({}) exited with code {}:\n{}"
495496
raise ValueError(MSG.format(self.NAME, self.binpath, p.returncode,

0 commit comments

Comments
 (0)