From: Robert Yang Date: Wed, 22 Aug 2018 08:36:53 +0000 (+0800) Subject: lib/oe/patch.py: Clean up getstatusoutput usage X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39ef539345dd647979c04b7e461e0d07b9634e85;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git lib/oe/patch.py: Clean up getstatusoutput usage We can't use subprocess.check_output() or subprocess.call() here since the one who invokes runcmd() needs handle CmdError() exception (error out or ignore it). Signed-off-by: Robert Yang --- diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index af7aa523515..e0f0604251a 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py @@ -21,6 +21,7 @@ class CmdError(bb.BBHandledException): def runcmd(args, dir = None): import pipes + import subprocess if dir: olddir = os.path.abspath(os.curdir) @@ -33,7 +34,7 @@ def runcmd(args, dir = None): args = [ pipes.quote(str(arg)) for arg in args ] cmd = " ".join(args) # print("cmd: %s" % cmd) - (exitstatus, output) = oe.utils.getstatusoutput(cmd) + (exitstatus, output) = subprocess.getstatusoutput(cmd) if exitstatus != 0: raise CmdError(cmd, exitstatus >> 8, output) if " fuzz " in output: