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:
@ -32,7 +32,8 @@ def get_line_offsets_by_line_no(src):
|
||||
|
||||
|
||||
def fix_strings(filename):
|
||||
contents = io.open(filename, encoding='UTF-8').read()
|
||||
with io.open(filename, encoding='UTF-8') as f:
|
||||
contents = f.read()
|
||||
line_offsets = get_line_offsets_by_line_no(contents)
|
||||
|
||||
# Basically a mutable string
|
||||
|
Reference in New Issue
Block a user