[gnome-continuous-yocto/gnomeostree-3.28-rocko: 1946/8267] bitbake: siggen: properly close files rather than opening them inline
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-continuous-yocto/gnomeostree-3.28-rocko: 1946/8267] bitbake: siggen: properly close files rather than opening them inline
- Date: Sat, 16 Dec 2017 22:32:23 +0000 (UTC)
commit fac16ff8f7b1090324955e5198996324c6dcdc1d
Author: Paul Eggleton <paul eggleton linux intel com>
Date: Thu Aug 11 15:37:00 2016 +1200
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>
bitbake/lib/bb/siggen.py | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index 5d8a253..9b2f658 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -363,10 +363,12 @@ def clean_basepaths_list(a):
def compare_sigfiles(a, b, recursecb = None):
output = []
- p1 = pickle.Unpickler(open(a, "rb"))
- a_data = p1.load()
- p2 = pickle.Unpickler(open(b, "rb"))
- b_data = p2.load()
+ with open(a, 'rb') as f:
+ p1 = pickle.Unpickler(ff)
+ a_data = p1.load()
+ with open(b, 'rb') as f:
+ p2 = pickle.Unpickler(f)
+ b_data = p2.load()
def dict_diff(a, b, whitelist=set()):
sa = set(a.keys())
@@ -563,8 +565,9 @@ def calc_taskhash(sigdata):
def dump_sigfile(a):
output = []
- p1 = pickle.Unpickler(open(a, "rb"))
- a_data = p1.load()
+ with open(a, 'rb') as f:
+ p1 = pickle.Unpickler(f)
+ a_data = p1.load()
output.append("basewhitelist: %s" % (a_data['basewhitelist']))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]