From c4058f9f1ccd9c3bb2eecbb781cc1fee7001a9ac Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 15 Jan 2017 03:09:19 +0100 Subject: Extensions: run_command.py - inform user about output to stderr even if error code is zero (bzr r15417) --- share/extensions/run_command.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'share/extensions/run_command.py') diff --git a/share/extensions/run_command.py b/share/extensions/run_command.py index 7012c4274..950e9ed7c 100755 --- a/share/extensions/run_command.py +++ b/share/extensions/run_command.py @@ -61,8 +61,11 @@ def run(command_format, prog_name): except ImportError: # shouldn't happen... msg = "Neither subprocess.Popen nor popen2.Popen3 is available" - if rc and msg is None: - msg = "%s failed:\n%s\n%s\n" % (prog_name, out, err) + if msg is None: + if rc: + msg = "%s failed:\n%s\n%s\n" % (prog_name, out, err) + elif err: + sys.stderr.write("%s executed but logged the following error:\n%s\n%s\n" % (prog_name, out, err)) except Exception, inst: msg = "Error attempting to run %s: %s" % (prog_name, str(inst)) -- cgit v1.2.3