1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

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>
This commit is contained in:
Richard Purdie
2013-05-09 17:05:58 +01:00
parent d2ef952851
commit 566628d8cd
12 changed files with 79 additions and 74 deletions
+3 -3
View File
@@ -146,7 +146,7 @@ python package_do_split_gconvs () {
def calc_gconv_deps(fn, pkg, file_regex, output_pattern, group):
deps = []
f = open(fn, "r")
f = open(fn, "rb")
c_re = re.compile('^copy "(.*)"')
i_re = re.compile('^include "(\w+)".*')
for l in f.readlines():
@@ -167,7 +167,7 @@ python package_do_split_gconvs () {
def calc_charmap_deps(fn, pkg, file_regex, output_pattern, group):
deps = []
f = open(fn, "r")
f = open(fn, "rb")
c_re = re.compile('^copy "(.*)"')
i_re = re.compile('^include "(\w+)".*')
for l in f.readlines():
@@ -187,7 +187,7 @@ python package_do_split_gconvs () {
def calc_locale_deps(fn, pkg, file_regex, output_pattern, group):
deps = []
f = open(fn, "r")
f = open(fn, "rb")
c_re = re.compile('^copy "(.*)"')
i_re = re.compile('^include "(\w+)".*')
for l in f.readlines():