From 822c50273f7361be153037fab031b41f8b3ed433 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Fri, 6 Nov 2020 16:29:25 +0000 Subject: [PATCH] utils/check_subprocess_output: Fix std error output Fix stderr output being dropped unless there there is also output on stdout. --- devlib/utils/misc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/utils/misc.py b/devlib/utils/misc.py index 85230f0..2e29f69 100644 --- a/devlib/utils/misc.py +++ b/devlib/utils/misc.py @@ -189,7 +189,7 @@ def check_subprocess_output(process, timeout=None, ignore=None, inputtext=None): # Currently errors=replace is needed as 0x8c throws an error output = output.decode(sys.stdout.encoding or 'utf-8', "replace") if output else '' - error = error.decode(sys.stderr.encoding or 'utf-8', "replace") if output else '' + error = error.decode(sys.stderr.encoding or 'utf-8', "replace") if error else '' if timeout_expired: raise TimeoutError(process.args, output='\n'.join([output, error]))