diff options
| author | Joshua Lock <josh@linux.intel.com> | 2012-05-11 17:58:57 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-13 20:09:53 +0100 |
| commit | fb7fa0159ef01239cb3de956d1b1c528fe02162b (patch) | |
| tree | 5f80f56aab5ed827af44dc6f272b4a12007b0f55 | |
| parent | 09b231deb19799659cd181deebf3e5437048b619 (diff) | |
| download | poky-fb7fa0159ef01239cb3de956d1b1c528fe02162b.tar.gz | |
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>
| -rw-r--r-- | bitbake/lib/bb/siggen.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index 8c79b178fb..ca26919c9e 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py | |||
| @@ -201,7 +201,7 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
| 201 | for dep in data['runtaskdeps']: | 201 | for dep in data['runtaskdeps']: |
| 202 | data['runtaskhashes'][dep] = self.taskhash[dep] | 202 | data['runtaskhashes'][dep] = self.taskhash[dep] |
| 203 | 203 | ||
| 204 | p = pickle.Pickler(file(sigfile, "wb"), -1) | 204 | p = pickle.Pickler(open(sigfile, "wb"), -1) |
| 205 | p.dump(data) | 205 | p.dump(data) |
| 206 | 206 | ||
| 207 | def dump_sigs(self, dataCache): | 207 | def dump_sigs(self, dataCache): |
| @@ -250,9 +250,9 @@ def clean_basepaths(a): | |||
| 250 | return b | 250 | return b |
| 251 | 251 | ||
| 252 | def compare_sigfiles(a, b): | 252 | def compare_sigfiles(a, b): |
| 253 | p1 = pickle.Unpickler(file(a, "rb")) | 253 | p1 = pickle.Unpickler(open(a, "rb")) |
| 254 | a_data = p1.load() | 254 | a_data = p1.load() |
| 255 | p2 = pickle.Unpickler(file(b, "rb")) | 255 | p2 = pickle.Unpickler(open(b, "rb")) |
| 256 | b_data = p2.load() | 256 | b_data = p2.load() |
| 257 | 257 | ||
| 258 | def dict_diff(a, b, whitelist=set()): | 258 | def dict_diff(a, b, whitelist=set()): |
| @@ -331,7 +331,7 @@ def compare_sigfiles(a, b): | |||
| 331 | print "Hash for dependent task %s changed from %s to %s" % (dep, a[dep], b[dep]) | 331 | print "Hash for dependent task %s changed from %s to %s" % (dep, a[dep], b[dep]) |
| 332 | 332 | ||
| 333 | def dump_sigfile(a): | 333 | def dump_sigfile(a): |
| 334 | p1 = pickle.Unpickler(file(a, "rb")) | 334 | p1 = pickle.Unpickler(open(a, "rb")) |
| 335 | a_data = p1.load() | 335 | a_data = p1.load() |
| 336 | 336 | ||
| 337 | print "basewhitelist: %s" % (a_data['basewhitelist']) | 337 | print "basewhitelist: %s" % (a_data['basewhitelist']) |
