mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2025-08-14 09:27:21 +08:00
Fix resource warnings
This commit is contained in:
@ -58,7 +58,8 @@ def main(argv=None):
|
||||
retv = 0
|
||||
|
||||
for filename in args.filenames:
|
||||
contents = io.open(filename, encoding='UTF-8').read()
|
||||
with io.open(filename, encoding='UTF-8') as f:
|
||||
contents = f.read()
|
||||
retv |= check_docstring_first(contents, filename=filename)
|
||||
|
||||
return retv
|
||||
|
Reference in New Issue
Block a user