summaryrefslogtreecommitdiffstats
path: root/Tools/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-xTools/scripts/reindent.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Tools/scripts/reindent.py b/Tools/scripts/reindent.py
index 18424de..f6dadaa 100755
--- a/Tools/scripts/reindent.py
+++ b/Tools/scripts/reindent.py
@@ -118,7 +118,11 @@ def check(file):
if verbose:
print("checking", file, "...", end=' ')
with open(file, 'rb') as f:
- encoding, _ = tokenize.detect_encoding(f.readline)
+ try:
+ encoding, _ = tokenize.detect_encoding(f.readline)
+ except SyntaxError as se:
+ errprint("%s: SyntaxError: %s" % (file, str(se)))
+ return
try:
with open(file, encoding=encoding) as f:
r = Reindenter(f)