mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 12:49:34 +02: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:
@@ -1,3 +1,10 @@
|
||||
try:
|
||||
# Python 2
|
||||
import commands as cmdstatus
|
||||
except ImportError:
|
||||
# Python 3
|
||||
import subprocess as cmdstatus
|
||||
|
||||
def read_file(filename):
|
||||
try:
|
||||
f = file( filename, "r" )
|
||||
@@ -123,3 +130,6 @@ def packages_filter_out_system(d):
|
||||
if pkg not in blacklist and localepkg not in pkg:
|
||||
pkgs.append(pkg)
|
||||
return pkgs
|
||||
|
||||
def getstatusoutput(cmd):
|
||||
return cmdstatus.getstatusoutput(cmd)
|
||||
|
||||
Reference in New Issue
Block a user