mirror of https://github.com/tLDP/python-tldp
use a context to prevent FD leakage
This commit is contained in:
parent
bdbccb6823
commit
def752760e
|
@ -75,7 +75,8 @@ unknown_doctype = Namespace(
|
|||
sources = [y for x, y in locals().items() if x.startswith('ex_')]
|
||||
|
||||
for ex in sources:
|
||||
ex.content = open(ex.filename).read()
|
||||
with open(ex.filename) as f:
|
||||
ex.content = f.read()
|
||||
ex.stem, ex.ext = stem_and_ext(ex.filename)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue