diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-07 13:56:05 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-09 14:04:19 +0100 |
commit | e2e1dcd74bc45381baccf507c0309dd792229afe (patch) | |
tree | 71bca48bffd9feacc6bd8e2beb9c5a625ee1b297 /meta/lib | |
parent | 4f47b3a4726dd47e8a6db228fcaf25d1890e3e52 (diff) | |
download | openembedded-core-e2e1dcd74bc45381baccf507c0309dd792229afe.tar.gz openembedded-core-e2e1dcd74bc45381baccf507c0309dd792229afe.tar.bz2 openembedded-core-e2e1dcd74bc45381baccf507c0309dd792229afe.zip |
sanity/patch.py: Remove commands module usage
The commands module is removed in python3. Use the subprocess module instead
and the pipes module to replace the mkargs usage.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/patch.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index cbc5cd9755..8de73a7037 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py @@ -17,7 +17,7 @@ class CmdError(bb.BBHandledException): def runcmd(args, dir = None): - import commands + import subprocess, pipes if dir: olddir = os.path.abspath(os.curdir) @@ -27,10 +27,10 @@ def runcmd(args, dir = None): # print("cwd: %s -> %s" % (olddir, dir)) try: - args = [ commands.mkarg(str(arg)) for arg in args ] + args = [ pipes.quote(str(arg)) for arg in args ] cmd = " ".join(args) # print("cmd: %s" % cmd) - (exitstatus, output) = commands.getstatusoutput(cmd) + (exitstatus, output) = subprocess.getstatusoutput(cmd) if exitstatus != 0: raise CmdError(exitstatus >> 8, output) return output |