diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-03-17 14:11:15 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-03-17 14:11:15 +0200 |
commit | cdaedd0a9482754a803bce6a1901c7ab8903c9df (patch) | |
tree | 066641319855ac900777745816495f9d7faf356c | |
parent | 78d8a554c00bbfb6db25505c693f83e761034b00 (diff) | |
download | ick-helpers-cdaedd0a9482754a803bce6a1901c7ab8903c9df.tar.gz |
always capture output
-rw-r--r-- | ick_helpers.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/ick_helpers.py b/ick_helpers.py index d5bbdd3..74d5fb6 100644 --- a/ick_helpers.py +++ b/ick_helpers.py @@ -37,10 +37,7 @@ class Exec: kwargs["cwd"] = self.dirname if "check" not in kwargs: kwargs["check"] = True - if "stdout" not in kwargs: - kwargs["stdout"] = subprocess.PIPE - if "stderr" not in kwargs: - kwargs["stderr"] = subprocess.STDOUT + kwargs["capture_output"] = True debug("RUN:", args, kwargs) x = subprocess.run(args, **kwargs) @@ -54,14 +51,12 @@ class Exec: # Run a command, capture its stdout. Fail on non-zero exit. kwargs["check"] = True - kwargs["stdout"] = subprocess.PIPE x = self.run(*args, **kwargs) return x.stdout.decode("UTF-8") def run_silently(self, *args, **kwargs): # Run a command, don't capture output. Return exit code. - kwargs["stdout"] = kwargs["stderr"] = subprocess.DEVNULL kwargs["check"] = False return self.run(*args, **kwargs) |