mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 19:46:54 +00:00
Merge 51f8cc8ff0 into 78818b90cd
This commit is contained in:
commit
f8de2e4621
6 changed files with 9 additions and 14 deletions
|
|
@ -32,7 +32,7 @@ def get_line_offsets_by_line_no(src):
|
|||
|
||||
|
||||
def fix_strings(filename):
|
||||
contents = io.open(filename).read()
|
||||
contents = open(filename).read()
|
||||
line_offsets = get_line_offsets_by_line_no(contents)
|
||||
|
||||
# Basically a mutable string
|
||||
|
|
@ -52,7 +52,7 @@ def fix_strings(filename):
|
|||
|
||||
new_contents = ''.join(splitcontents)
|
||||
if contents != new_contents:
|
||||
with io.open(filename, 'w') as write_handle:
|
||||
with open(filename, 'w') as write_handle:
|
||||
write_handle.write(new_contents)
|
||||
return 1
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue