From ea5aec7ba7c00be01f0180d526a43d532dbd096a Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Thu, 2 Jun 2016 08:03:17 -0700 Subject: [PATCH] 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 --- lib/oe/external.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/oe/external.py b/lib/oe/external.py index f9865d5..9619244 100644 --- a/lib/oe/external.py +++ b/lib/oe/external.py @@ -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