summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/patch.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-07 13:56:05 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-09 14:06:51 +0100
commite16faa55daca2a87190ce66dc98a37906ecf90af (patch)
tree1a332be79ff1d5a44b399e7180196b9d66ec261d /meta/lib/oe/patch.py
parente1b5647d2c84579b65f54aa7ca07a41b1dd9470d (diff)
downloadpoky-e16faa55daca2a87190ce66dc98a37906ecf90af.tar.gz
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. (From OE-Core rev: e2e1dcd74bc45381baccf507c0309dd792229afe) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/patch.py')
-rw-r--r--meta/lib/oe/patch.py6
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):
17 17
18 18
19def runcmd(args, dir = None): 19def runcmd(args, dir = None):
20 import commands 20 import subprocess, pipes
21 21
22 if dir: 22 if dir:
23 olddir = os.path.abspath(os.curdir) 23 olddir = os.path.abspath(os.curdir)
@@ -27,10 +27,10 @@ def runcmd(args, dir = None):
27 # print("cwd: %s -> %s" % (olddir, dir)) 27 # print("cwd: %s -> %s" % (olddir, dir))
28 28
29 try: 29 try:
30 args = [ commands.mkarg(str(arg)) for arg in args ] 30 args = [ pipes.quote(str(arg)) for arg in args ]
31 cmd = " ".join(args) 31 cmd = " ".join(args)
32 # print("cmd: %s" % cmd) 32 # print("cmd: %s" % cmd)
33 (exitstatus, output) = commands.getstatusoutput(cmd) 33 (exitstatus, output) = subprocess.getstatusoutput(cmd)
34 if exitstatus != 0: 34 if exitstatus != 0:
35 raise CmdError(exitstatus >> 8, output) 35 raise CmdError(exitstatus >> 8, output)
36 return output 36 return output