summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-08-11 15:37:00 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-18 10:06:26 +0100
commitfac16ff8f7b1090324955e5198996324c6dcdc1d (patch)
tree099b2cb0e687b12775662f6bb5b22ca7f89b1c21 /bitbake
parent0eb6d709b6c38aa27f33d8b0ef977a33350f0d75 (diff)
downloadpoky-fac16ff8f7b1090324955e5198996324c6dcdc1d.tar.gz
bitbake: siggen: properly close files rather than opening them inline
If you don't do this, with Python 3 you get a warning on exit under some circumstances. (Bitbake rev: 49502685df3e616023df352823156381b1f79cd3) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/siggen.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 5d8a253a1f..9b2f658a46 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -363,10 +363,12 @@ def clean_basepaths_list(a):
363def compare_sigfiles(a, b, recursecb = None): 363def compare_sigfiles(a, b, recursecb = None):
364 output = [] 364 output = []
365 365
366 p1 = pickle.Unpickler(open(a, "rb")) 366 with open(a, 'rb') as f:
367 a_data = p1.load() 367 p1 = pickle.Unpickler(ff)
368 p2 = pickle.Unpickler(open(b, "rb")) 368 a_data = p1.load()
369 b_data = p2.load() 369 with open(b, 'rb') as f:
370 p2 = pickle.Unpickler(f)
371 b_data = p2.load()
370 372
371 def dict_diff(a, b, whitelist=set()): 373 def dict_diff(a, b, whitelist=set()):
372 sa = set(a.keys()) 374 sa = set(a.keys())
@@ -563,8 +565,9 @@ def calc_taskhash(sigdata):
563def dump_sigfile(a): 565def dump_sigfile(a):
564 output = [] 566 output = []
565 567
566 p1 = pickle.Unpickler(open(a, "rb")) 568 with open(a, 'rb') as f:
567 a_data = p1.load() 569 p1 = pickle.Unpickler(f)
570 a_data = p1.load()
568 571
569 output.append("basewhitelist: %s" % (a_data['basewhitelist'])) 572 output.append("basewhitelist: %s" % (a_data['basewhitelist']))
570 573