mirror of
https://git.yoctoproject.org/poky
synced 2026-02-06 16:56:37 +01:00
Where there isn't a copyright statement, add one to make it explicit. Also add license identifiers as MIT if there isn't one. (From OE-Core rev: bb731d1f3d2a1d50ec0aed864dbca54cf795b040) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
25 lines
769 B
Python
25 lines
769 B
Python
#
|
|
# Copyright OpenEmbedded Contributors
|
|
#
|
|
# SPDX-License-Identifier: MIT
|
|
#
|
|
import subprocess
|
|
|
|
class OETestCalledProcessError(subprocess.CalledProcessError):
|
|
def __str__(self):
|
|
def strify(o):
|
|
if isinstance(o, bytes):
|
|
return o.decode("utf-8", errors="replace")
|
|
else:
|
|
return o
|
|
|
|
s = "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
|
|
if hasattr(self, "output") and self.output:
|
|
s = s + "\nStandard Output: " + strify(self.output)
|
|
if hasattr(self, "stderr") and self.stderr:
|
|
s = s + "\nStandard Error: " + strify(self.stderr)
|
|
return s
|
|
|
|
def errors_have_output():
|
|
subprocess.CalledProcessError = OETestCalledProcessError
|