mirror of
https://git.yoctoproject.org/poky
synced 2026-03-19 13:49:41 +01:00
lib/oe/packagedata: Use with to control file handle lifetime
(From OE-Core rev: 28b3635b7f40b627a9d6294a78589c78f0c682c8) Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
c4f2a115f7
commit
3af1c66939
@@ -17,9 +17,8 @@ def read_pkgdatafile(fn):
|
||||
|
||||
if os.access(fn, os.R_OK):
|
||||
import re
|
||||
f = open(fn, 'r')
|
||||
lines = f.readlines()
|
||||
f.close()
|
||||
with open(fn, 'r') as f:
|
||||
lines = f.readlines()
|
||||
r = re.compile("([^:]+):\s*(.*)")
|
||||
for l in lines:
|
||||
m = r.match(l)
|
||||
|
||||
Reference in New Issue
Block a user