summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2012-05-30 17:18:15 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-05 22:54:20 +0100
commitbc9f7d7b7eda1c45ad1aaee469ebe28ee1c0c96b (patch)
tree99db17b1f460e163981446392afe82d3ec4ccba4 /scripts
parent3c368f4c989bee68953b6d0fbf2adc44f97cc100 (diff)
downloadopenembedded-core-bc9f7d7b7eda1c45ad1aaee469ebe28ee1c0c96b.tar.gz
generate-manifest-2.7.py: replace os.popen with os.unlink
The os.popen function would fail (more or less) silently if the executed program cannot be found, and here what we need is os.system not os.popen since it doesn't use the return value, use os.unlink() and ignore exceptions from it would be better as Chris suggested. [YOCTO #2454] Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/contrib/python/generate-manifest-2.7.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/contrib/python/generate-manifest-2.7.py b/scripts/contrib/python/generate-manifest-2.7.py
index 7b43137bd8..5c527241e7 100755
--- a/scripts/contrib/python/generate-manifest-2.7.py
+++ b/scripts/contrib/python/generate-manifest-2.7.py
@@ -149,7 +149,10 @@ class MakefileMaker:
if __name__ == "__main__":
if len( sys.argv ) > 1:
- os.popen( "rm -f ./%s" % sys.argv[1] )
+ try:
+ os.unlink(sys.argv[1])
+ except Exception:
+ sys.exc_clear()
outfile = file( sys.argv[1], "w" )
else:
outfile = sys.stdout