1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 12:49:46 +00:00

classes/lib: Fix getcmdstatus breakage

I mistakenly thought subprocess had getcmdstatus in python 2. It doesn't so lets
add a wrapper and have this work in both worlds.

(From OE-Core rev: 2253e9f12734c6e6aa489942b5e4628eca1fa29d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2013-05-09 14:55:04 +00:00
parent d529c11fa5
commit b54339d633
6 changed files with 20 additions and 11 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ class CmdError(bb.BBHandledException):
def runcmd(args, dir = None):
import subprocess, pipes
import pipes
if dir:
olddir = os.path.abspath(os.curdir)
@@ -30,7 +30,7 @@ def runcmd(args, dir = None):
args = [ pipes.quote(str(arg)) for arg in args ]
cmd = " ".join(args)
# print("cmd: %s" % cmd)
(exitstatus, output) = subprocess.getstatusoutput(cmd)
(exitstatus, output) = oe.utils.getstatusoutput(cmd)
if exitstatus != 0:
raise CmdError(exitstatus >> 8, output)
return output