]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/testsdk: print output correctly on failure
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Thu, 23 Jun 2016 12:07:02 +0000 (00:07 +1200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 7 Jul 2016 12:29:01 +0000 (13:29 +0100)
With Python 3 we get a bytes object from the command output and not a
string, which gives some ugly formatting for error messages unless you
decode it first.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/testsdk.bbclass

index f4dc2c36dc0130194835ff91317d36e22a1b4169..18f7678d37f382af4849ea446f054fad5c208296 100644 (file)
@@ -65,7 +65,7 @@ def testsdk_main(d):
     try:
         subprocess.check_output("cd %s; %s <<EOF\n./tc\nY\nEOF" % (sdktestdir, tcname), shell=True)
     except subprocess.CalledProcessError as e:
-        bb.fatal("Couldn't install the SDK:\n%s" % e.output)
+        bb.fatal("Couldn't install the SDK:\n%s" % e.output.decode("utf-8"))
 
     try:
         run_test_context(SDKTestContext, d, sdktestdir, tcname, pn)
@@ -116,7 +116,7 @@ def testsdkext_main(d):
     try:
         subprocess.check_output("%s -y -d %s/tc" % (tcname, testdir), shell=True)
     except subprocess.CalledProcessError as e:
-        bb.fatal("Couldn't install the SDK EXT:\n%s" % e.output)
+        bb.fatal("Couldn't install the SDK EXT:\n%s" % e.output.decode("utf-8"))
 
     try:
         bb.plain("Running SDK Compatibility tests ...")