Skip to content

Commit

Permalink
Fix CI 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Qingfu-Liu committed Dec 14, 2023
1 parent 225848c commit d65507a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tools/check_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
if suffix in SUFFICES:
with open(os.path.join(root, file)) as f:
contents = f.read()
try:
contents.decode('ascii')
except UnicodeDecodeError:
if not contents.isascii():
for line in contents.split('\n'):
try:
line.decode('ascii')
except UnicodeDecodeError:
if not line.isascii():
raise Exception('Detected non-ascii characters in file {}, line: "{}"'.format(os.path.join(root, file), line))

0 comments on commit d65507a

Please sign in to comment.