From e472ff51ad59b9efe58dacc08756115de034b82f Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 25 Feb 2023 12:16:05 +0000 Subject: [PATCH] commands: Don't process output if the command failed We don't want any error messages to be returned here. Signed-off-by: Michael Tremer --- src/python/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/python/__init__.py b/src/python/__init__.py index b57d60f..4d367b9 100644 --- a/src/python/__init__.py +++ b/src/python/__init__.py @@ -278,8 +278,12 @@ class Bricklayer(object): if bind: self._unbind(bind) + # Skip any output processing on error + if p.returncode and error_ok: + return + # Check the return code (raises CalledProcessError on non-zero) - if not error_ok: + elif not error_ok: p.check_returncode() # There is no output in interactive mode -- 2.47.3