##// END OF EJS Templates
check-seclevel: use a context manager for file I/O
Bryan O'Sullivan -
r27770:1b8c7d59 default
parent child Browse files
Show More
@@ -107,11 +107,8 b' def checkfile(ui, filename, initlevel):'
107 filename = 'stdin'
107 filename = 'stdin'
108 doc = sys.stdin.read()
108 doc = sys.stdin.read()
109 else:
109 else:
110 fp = open(filename)
110 with open(filename) as fp:
111 try:
112 doc = fp.read()
111 doc = fp.read()
113 finally:
114 fp.close()
115
112
116 ui.note(('checking input from %s with initlevel %d\n') %
113 ui.note(('checking input from %s with initlevel %d\n') %
117 (filename, initlevel))
114 (filename, initlevel))
General Comments 0
You need to be logged in to leave comments. Login now