summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2012-06-01 16:03:58 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-05 22:49:19 +0100
commit0efe773c1752ab28b6cc488da19892d490b5b92b (patch)
tree91234e5f655dc7c592591887d9e243026e340a43 /scripts
parentde4cdfd6bc1280ac7ac0559b87734d26294ef773 (diff)
downloadpoky-0efe773c1752ab28b6cc488da19892d490b5b92b.tar.gz
poky-0efe773c1752ab28b6cc488da19892d490b5b92b.tar.bz2
poky-0efe773c1752ab28b6cc488da19892d490b5b92b.zip
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 <liezhi.yang@windriver.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/bsp/kernel.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
index 8b3aa72c9c..7c6da4e2eb 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 = []