diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-09 14:55:04 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-09 16:05:08 +0100 |
commit | b54339d63339c99f24845f69f49cd1fe996e6e7c (patch) | |
tree | 73b3da57a66ab4a0f6fa06a479efc5449126342f /meta/lib/oe/utils.py | |
parent | d529c11fa512e7f06044378a7ec7137765ea8eb4 (diff) | |
download | ast2050-yocto-poky-b54339d63339c99f24845f69f49cd1fe996e6e7c.zip ast2050-yocto-poky-b54339d63339c99f24845f69f49cd1fe996e6e7c.tar.gz |
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>
Diffstat (limited to 'meta/lib/oe/utils.py')
-rw-r--r-- | meta/lib/oe/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index ed94096..ec8260d 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -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) |