oe.external: use bb.process.run

oe.path.check_output was returning a bytes, not an str. Switch to bb.process
to resolve issues with python3.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
This commit is contained in:
Christopher Larson
2016-06-02 08:03:17 -07:00
parent 3262087a71
commit ea5aec7ba7

View File

@@ -4,8 +4,6 @@ import bb
def run(d, cmd, *args):
import subprocess
topdir = d.getVar('TMPDIR', True)
toolchain_path = d.getVar('EXTERNAL_TOOLCHAIN', True)
if toolchain_path:
@@ -14,13 +12,9 @@ def run(d, cmd, *args):
args = [path] + list(args)
try:
output = oe.path.check_output(args, cwd=topdir, stderr=subprocess.STDOUT)
except oe.path.CalledProcessError as exc:
import pipes
bb.debug(1, "{0} failed: {1}".format(' '.join(pipes.quote(a) for a in args), exc.output))
except OSError as exc:
import pipes
bb.debug(1, "{0} failed: {1}".format(' '.join(pipes.quote(a) for a in args), str(exc)))
output, _ = bb.process.run(args, cwd=topdir)
except bb.process.CmdError as exc:
bb.debug(1, str(exc))
else:
return output