Commit 7c471a14 authored by Jason R. Coombs's avatar Jason R. Coombs

Use context manager for brevity

parent 0f7f8d71
...@@ -70,11 +70,8 @@ if PY3: ...@@ -70,11 +70,8 @@ if PY3:
globs = globals() globs = globals()
if locs is None: if locs is None:
locs = globs locs = globs
f = open(fn, 'rb') with open(fn, 'rb') as f:
try:
source = f.read() source = f.read()
finally:
f.close()
exec(compile(source, fn, 'exec'), globs, locs) exec(compile(source, fn, 'exec'), globs, locs)
def reraise(tp, value, tb=None): def reraise(tp, value, tb=None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment