use a context to prevent FD leakage

This commit is contained in:
Martin A. Brown 2016-03-14 20:07:40 -07:00
parent bdbccb6823
commit def752760e
1 changed files with 2 additions and 1 deletions

View File

@ -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)