Fix resource warnings

This commit is contained in:
Anthony Sottile
2018-06-18 00:00:38 -07:00
parent a193eab99e
commit 5dc306b35d
7 changed files with 14 additions and 7 deletions

View File

@ -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