From: Robert Yang Date: Fri, 1 Jun 2012 08:03:58 +0000 (+0800) Subject: kernel.py: replace os.popen with subprocess.Popen X-Git-Tag: rev_ivi_2015_02_04~17027 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=661d090efed0414f02aa2c7bd4d414873353290d;p=scm%2Fbb%2Ftizen-distro.git kernel.py: replace os.popen with subprocess.Popen Replace os.popen with subprocess.Popen since the older function would fail (more or less) silently if the executed program cannot be found More info: http://docs.python.org/library/subprocess.html#subprocess-replacements [YOCTO #2454] Signed-off-by: Robert Yang --- diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py index 8b3aa72..7c6da4e 100644 --- a/scripts/lib/bsp/kernel.py +++ b/scripts/lib/bsp/kernel.py @@ -31,6 +31,7 @@ import os import shutil from tags import * import glob +import subprocess def find_bblayers(scripts_path): @@ -678,7 +679,7 @@ def base_branches(context): print "Getting branches from remote repo %s..." % giturl gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl) - tmp = os.popen(gitcmd).read() + tmp = subprocess.Popen(gitcmd, shell=True, stdout=subprocess.PIPE).stdout.read() branches = [] @@ -708,7 +709,7 @@ def all_branches(context): print "Getting branches from remote repo %s..." % giturl gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl) - tmp = os.popen(gitcmd).read() + tmp = subprocess.Popen(gitcmd, shell=True, stdout=subprocess.PIPE).stdout.read() branches = []