summaryrefslogtreecommitdiff
path: root/scripts/dev/misc_checks.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-09-10 16:40:23 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-09-10 16:40:23 +0200
commitabed001aa9471695b77fb4cd37f4fc3bd7ef2ca0 (patch)
tree046909b725870157ced5a4ebb389867c7ad0d8e6 /scripts/dev/misc_checks.py
parente3fa34b97057fb05f6a297f727e7c8bbd4be0099 (diff)
downloadqutebrowser-abed001aa9471695b77fb4cd37f4fc3bd7ef2ca0.tar.gz
qutebrowser-abed001aa9471695b77fb4cd37f4fc3bd7ef2ca0.zip
misc_checks: Handle remaining binary files gracefully
Diffstat (limited to 'scripts/dev/misc_checks.py')
-rw-r--r--scripts/dev/misc_checks.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/dev/misc_checks.py b/scripts/dev/misc_checks.py
index 3586c5a17..df2845405 100644
--- a/scripts/dev/misc_checks.py
+++ b/scripts/dev/misc_checks.py
@@ -63,6 +63,15 @@ def _get_files(
if not filename or path.suffix in BINARY_EXTS or is_ignored:
continue
+ try:
+ with tokenize.open(str(path)):
+ pass
+ except SyntaxError as e:
+ # Could not find encoding
+ utils.print_col("{} - maybe {} should be added to BINARY_EXTS?".format(
+ str(e).capitalize(), path.suffix), 'yellow')
+ continue
+
if verbose:
print(path)