mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-13 07:41:19 +08:00
Fix resource warnings
This commit is contained in:
@@ -14,7 +14,8 @@ def main(argv=None):
|
||||
|
||||
retv = 0
|
||||
for filename in args.files:
|
||||
original_contents = io.open(filename, encoding='UTF-8').read()
|
||||
with io.open(filename, encoding='UTF-8') as f:
|
||||
original_contents = f.read()
|
||||
new_contents = autopep8.fix_code(original_contents, args)
|
||||
if original_contents != new_contents:
|
||||
print('Fixing {}'.format(filename))
|
||||
|
||||
Reference in New Issue
Block a user