debug statements hook works for non-utf8 files

This commit is contained in:
Anthony Sottile
2017-08-14 20:20:32 -07:00
parent 5c2430e238
commit 2913408db3
2 changed files with 11 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class ImportStatementParser(ast.NodeVisitor):
def check_file_for_debug_statements(filename):
try:
ast_obj = ast.parse(open(filename).read(), filename=filename)
ast_obj = ast.parse(open(filename, 'rb').read(), filename=filename)
except SyntaxError:
print('{} - Could not parse ast'.format(filename))
print()