[r21829]ImportProGen: Prevent leaking file handle
svn: r21832
This commit is contained in:
parent
9d8d1576b4
commit
d3d80b443e
@ -462,7 +462,9 @@ class PG30_Def:
|
||||
|
||||
# This can throw a IOError
|
||||
import io
|
||||
lines = io.open(fname, buffering=1, encoding='cp437', errors='strict').readlines()
|
||||
lines = None
|
||||
with f = io.open(fname, buffering=1, encoding='cp437', errors='strict'):
|
||||
lines = f.readlines()
|
||||
lines = [l.strip() for l in lines]
|
||||
content = '\n'.join(lines).encode('utf-8')
|
||||
parts = re.split(r'\n(?=\[)', content)
|
||||
|
Loading…
Reference in New Issue
Block a user