summaryrefslogtreecommitdiffstats
path: root/scripts/contrib/python
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:56:32 +0100
commit09a7dc9a4654719699258ba9422f14095147c7c2 (patch)
tree4d71283cc7432248690deb895d4e63f930f203c7 /scripts/contrib/python
parentd068a7577cb12f87bba9f2f3959689bff90c4966 (diff)
downloadpoky-09a7dc9a4654719699258ba9422f14095147c7c2.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] (From OE-Core rev: bc9f7d7b7eda1c45ad1aaee469ebe28ee1c0c96b) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib/python')
-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:
149if __name__ == "__main__": 149if __name__ == "__main__":
150 150
151 if len( sys.argv ) > 1: 151 if len( sys.argv ) > 1:
152 os.popen( "rm -f ./%s" % sys.argv[1] ) 152 try:
153 os.unlink(sys.argv[1])
154 except Exception:
155 sys.exc_clear()
153 outfile = file( sys.argv[1], "w" ) 156 outfile = file( sys.argv[1], "w" )
154 else: 157 else:
155 outfile = sys.stdout 158 outfile = sys.stdout