Skip to content
Snippets Groups Projects
Commit 1b8c7d59 authored by Bryan O'Sullivan's avatar Bryan O'Sullivan
Browse files

check-seclevel: use a context manager for file I/O

parent 40bd01be
No related branches found
No related tags found
No related merge requests found
......@@ -107,6 +107,5 @@
filename = 'stdin'
doc = sys.stdin.read()
else:
fp = open(filename)
try:
with open(filename) as fp:
doc = fp.read()
......@@ -112,6 +111,4 @@
doc = fp.read()
finally:
fp.close()
ui.note(('checking input from %s with initlevel %d\n') %
(filename, initlevel))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment