From e476eb900e04224664fddcd690e42f874e0068d1 Mon Sep 17 00:00:00 2001 From: Hans-Peter Deifel <hpd@hpdeifel.de> Date: Tue, 9 Apr 2019 15:36:29 +0200 Subject: [PATCH] wta: Print stderr in case the subprocess fails --- wta/bench.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wta/bench.py b/wta/bench.py index b92b7ec..2060322 100755 --- a/wta/bench.py +++ b/wta/bench.py @@ -81,11 +81,15 @@ def run_one(args, i): copar_args = [copar, 'refine', '--stats-json', f] - out = subprocess.run( - copar_args, - stdout=subprocess.DEVNULL, - stderr=subprocess.PIPE, - check=True) + try: + out = subprocess.run( + copar_args, + stdout=subprocess.DEVNULL, + stderr=subprocess.PIPE, + check=True) + except subprocess.CalledProcessError as e: + print("error: %s" % e.stderr.decode('utf-8')) + raise stats = json.loads(out.stderr.decode('utf-8')) -- GitLab