mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
lib/bb/siggen: use open() rather than the file constructor
The Python documentation states: "When opening a file, it’s preferable to use open() instead of invoking the file constructor directly." [1] Further in Python 3 direct use of the file constructor is no longer possible. 1. http://docs.python.org/library/functions.html#open (Bitbake rev: 759f953e29a7131614e5b1f0312edf2b17523675) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
09b231deb1
commit
fb7fa0159e
@@ -201,7 +201,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
|
|||||||
for dep in data['runtaskdeps']:
|
for dep in data['runtaskdeps']:
|
||||||
data['runtaskhashes'][dep] = self.taskhash[dep]
|
data['runtaskhashes'][dep] = self.taskhash[dep]
|
||||||
|
|
||||||
p = pickle.Pickler(file(sigfile, "wb"), -1)
|
p = pickle.Pickler(open(sigfile, "wb"), -1)
|
||||||
p.dump(data)
|
p.dump(data)
|
||||||
|
|
||||||
def dump_sigs(self, dataCache):
|
def dump_sigs(self, dataCache):
|
||||||
@@ -250,9 +250,9 @@ def clean_basepaths(a):
|
|||||||
return b
|
return b
|
||||||
|
|
||||||
def compare_sigfiles(a, b):
|
def compare_sigfiles(a, b):
|
||||||
p1 = pickle.Unpickler(file(a, "rb"))
|
p1 = pickle.Unpickler(open(a, "rb"))
|
||||||
a_data = p1.load()
|
a_data = p1.load()
|
||||||
p2 = pickle.Unpickler(file(b, "rb"))
|
p2 = pickle.Unpickler(open(b, "rb"))
|
||||||
b_data = p2.load()
|
b_data = p2.load()
|
||||||
|
|
||||||
def dict_diff(a, b, whitelist=set()):
|
def dict_diff(a, b, whitelist=set()):
|
||||||
@@ -331,7 +331,7 @@ def compare_sigfiles(a, b):
|
|||||||
print "Hash for dependent task %s changed from %s to %s" % (dep, a[dep], b[dep])
|
print "Hash for dependent task %s changed from %s to %s" % (dep, a[dep], b[dep])
|
||||||
|
|
||||||
def dump_sigfile(a):
|
def dump_sigfile(a):
|
||||||
p1 = pickle.Unpickler(file(a, "rb"))
|
p1 = pickle.Unpickler(open(a, "rb"))
|
||||||
a_data = p1.load()
|
a_data = p1.load()
|
||||||
|
|
||||||
print "basewhitelist: %s" % (a_data['basewhitelist'])
|
print "basewhitelist: %s" % (a_data['basewhitelist'])
|
||||||
|
|||||||
Reference in New Issue
Block a user