diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-03-17 14:06:07 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-03-17 14:06:07 +0200 |
commit | 78d8a554c00bbfb6db25505c693f83e761034b00 (patch) | |
tree | 96aec10054ff64756fe31161412983d785ad8f94 | |
parent | 6267939778fc94255ea0916b5cad97db3a27aec9 (diff) | |
download | ick-helpers-78d8a554c00bbfb6db25505c693f83e761034b00.tar.gz |
always show captured stdout, stderr
-rw-r--r-- | ick_helpers.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ick_helpers.py b/ick_helpers.py index 9651060..d5bbdd3 100644 --- a/ick_helpers.py +++ b/ick_helpers.py @@ -44,9 +44,10 @@ class Exec: debug("RUN:", args, kwargs) x = subprocess.run(args, **kwargs) - if kwargs["stdout"] == subprocess.PIPE: - if x.stdout: - sys.stdout.write(x.stdout.decode("UTF-8")) + if x.stdout: + sys.stdout.write("STDOUT:\n%s" % x.stdout.decode("UTF-8")) + if x.stderr: + sys.stdout.write("STDERR:\n%s" % x.stderr.decode("UTF-8")) return x def get_stdout(self, *args, **kwargs): |