diff options
Diffstat (limited to 'meta/lib/oeqa/utils/subprocesstweak.py')
-rw-r--r-- | meta/lib/oeqa/utils/subprocesstweak.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/meta/lib/oeqa/utils/subprocesstweak.py b/meta/lib/oeqa/utils/subprocesstweak.py index 3e43ed547b..1774513023 100644 --- a/meta/lib/oeqa/utils/subprocesstweak.py +++ b/meta/lib/oeqa/utils/subprocesstweak.py | |||
@@ -8,16 +8,11 @@ import subprocess | |||
8 | class OETestCalledProcessError(subprocess.CalledProcessError): | 8 | class OETestCalledProcessError(subprocess.CalledProcessError): |
9 | def __str__(self): | 9 | def __str__(self): |
10 | def strify(o): | 10 | def strify(o): |
11 | if isinstance(o, bytes): | 11 | return o.decode("utf-8", errors="replace") if isinstance(o, bytes) else o |
12 | return o.decode("utf-8", errors="replace") | ||
13 | else: | ||
14 | return o | ||
15 | 12 | ||
16 | s = "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode) | 13 | s = super().__str__() |
17 | if hasattr(self, "output") and self.output: | 14 | s = s + "\nStandard Output: " + strify(self.output) |
18 | s = s + "\nStandard Output: " + strify(self.output) | 15 | s = s + "\nStandard Error: " + strify(self.stderr) |
19 | if hasattr(self, "stderr") and self.stderr: | ||
20 | s = s + "\nStandard Error: " + strify(self.stderr) | ||
21 | return s | 16 | return s |
22 | 17 | ||
23 | def errors_have_output(): | 18 | def errors_have_output(): |