diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-09 17:05:58 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-05-09 22:28:04 +0100 |
commit | 566628d8cd674a964d5824391cfd1585a1a22a87 (patch) | |
tree | 670366ee1492ff8bb18b9261dfab9d06c06b0a2d /meta/classes/libc-package.bbclass | |
parent | d2ef952851d9ef16875fdbbbc6ae6eb6cfc10cc0 (diff) | |
download | poky-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/classes/libc-package.bbclass')
-rw-r--r-- | meta/classes/libc-package.bbclass | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass index 3a131540f3..74e2078544 100644 --- a/meta/classes/libc-package.bbclass +++ b/meta/classes/libc-package.bbclass | |||
@@ -146,7 +146,7 @@ python package_do_split_gconvs () { | |||
146 | 146 | ||
147 | def calc_gconv_deps(fn, pkg, file_regex, output_pattern, group): | 147 | def calc_gconv_deps(fn, pkg, file_regex, output_pattern, group): |
148 | deps = [] | 148 | deps = [] |
149 | f = open(fn, "r") | 149 | f = open(fn, "rb") |
150 | c_re = re.compile('^copy "(.*)"') | 150 | c_re = re.compile('^copy "(.*)"') |
151 | i_re = re.compile('^include "(\w+)".*') | 151 | i_re = re.compile('^include "(\w+)".*') |
152 | for l in f.readlines(): | 152 | for l in f.readlines(): |
@@ -167,7 +167,7 @@ python package_do_split_gconvs () { | |||
167 | 167 | ||
168 | def calc_charmap_deps(fn, pkg, file_regex, output_pattern, group): | 168 | def calc_charmap_deps(fn, pkg, file_regex, output_pattern, group): |
169 | deps = [] | 169 | deps = [] |
170 | f = open(fn, "r") | 170 | f = open(fn, "rb") |
171 | c_re = re.compile('^copy "(.*)"') | 171 | c_re = re.compile('^copy "(.*)"') |
172 | i_re = re.compile('^include "(\w+)".*') | 172 | i_re = re.compile('^include "(\w+)".*') |
173 | for l in f.readlines(): | 173 | for l in f.readlines(): |
@@ -187,7 +187,7 @@ python package_do_split_gconvs () { | |||
187 | 187 | ||
188 | def calc_locale_deps(fn, pkg, file_regex, output_pattern, group): | 188 | def calc_locale_deps(fn, pkg, file_regex, output_pattern, group): |
189 | deps = [] | 189 | deps = [] |
190 | f = open(fn, "r") | 190 | f = open(fn, "rb") |
191 | c_re = re.compile('^copy "(.*)"') | 191 | c_re = re.compile('^copy "(.*)"') |
192 | i_re = re.compile('^include "(\w+)".*') | 192 | i_re = re.compile('^include "(\w+)".*') |
193 | for l in f.readlines(): | 193 | for l in f.readlines(): |