summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/packagedata.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-09 17:05:58 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-09 22:28:04 +0100
commit566628d8cd674a964d5824391cfd1585a1a22a87 (patch)
tree670366ee1492ff8bb18b9261dfab9d06c06b0a2d /meta/lib/oe/packagedata.py
parentd2ef952851d9ef16875fdbbbc6ae6eb6cfc10cc0 (diff)
downloadpoky-566628d8cd674a964d5824391cfd1585a1a22a87.tar.gz
class/lib: Fix up various file access methods
There are various bits of cruft that have built up around our file accesses. This patch cleans some of them up, specifically: * Remove pointless "from __builtin__ import file" * Use open(), not file() * Wrap file usage in a with container to ensure files are closed * Add missing .close() calls in some cases (From OE-Core rev: a43e0a8ecd0441131e929daf998c3cd454d9c8f3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/packagedata.py')
-rw-r--r--meta/lib/oe/packagedata.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py
index 62fd71898e..14c38bdc0f 100644
--- a/meta/lib/oe/packagedata.py
+++ b/meta/lib/oe/packagedata.py
@@ -12,7 +12,7 @@ def read_pkgdatafile(fn):
12 12
13 if os.access(fn, os.R_OK): 13 if os.access(fn, os.R_OK):
14 import re 14 import re
15 f = file(fn, 'r') 15 f = open(fn, 'r')
16 lines = f.readlines() 16 lines = f.readlines()
17 f.close() 17 f.close()
18 r = re.compile("([^:]+):\s*(.*)") 18 r = re.compile("([^:]+):\s*(.*)")