From b26eaeb08c3c497e9b65122f676bb5f7ef495d21 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Sun, 12 Jan 2020 12:03:23 -0600 Subject: [PATCH] helpers.exo: only report non-empty stderr Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/bup/helpers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/bup/helpers.py b/lib/bup/helpers.py index 38fbc24..a5c5165 100644 --- a/lib/bup/helpers.py +++ b/lib/bup/helpers.py @@ -327,8 +327,9 @@ def exo(cmd, preexec_fn=preexec_fn) out, err = p.communicate(input) if check and p.returncode != 0: - raise Exception('subprocess %r failed with status %d, stderr: %r' - % (b' '.join(map(quote, cmd)), p.returncode, err)) + raise Exception('subprocess %r failed with status %d%s' + % (b' '.join(map(quote, cmd)), p.returncode, + ', stderr: %r' % err if err else '')) return out, err, p def readpipe(argv, preexec_fn=None, shell=False): -- 2.39.2