]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
oeqa: fix OETestCalledProcessError for check_output method
authorPeter Marko <peter.marko@siemens.com>
Thu, 31 Jul 2025 19:35:06 +0000 (21:35 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 4 Aug 2025 17:04:00 +0000 (18:04 +0100)
commitd13f444468b4b10f913b3cf01d7d13ef9d42838e
treec4a4b77223d7fbc71451cb7f364f2d01b86fe449
parent904b6967ad4730ae32aad785d6b53ca3f5af2cd4
oeqa: fix OETestCalledProcessError for check_output method

Per documentation, subprocess.CalledProcessError exception has stderr
filled out only for run method, it's None for check_output method.
So serialize it only if it's not None.

Avoids:
  File "<poky-dir>/meta/lib/oeqa/utils/subprocesstweak.py", line 15, in __str__
    s = s + "\nStandard Error: " + strify(self.stderr)
        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to str

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/subprocesstweak.py