diff --git a/pep-0505/find-pep505.py b/pep-0505/find-pep505.py index 0224ff8c0..828e98715 100644 --- a/pep-0505/find-pep505.py +++ b/pep-0505/find-pep505.py @@ -402,7 +402,10 @@ def main(): for file_ in sys.argv[1:]: with open(file_) as source: - tree = ast.parse(source.read(), filename=file_) + try: + tree = ast.parse(source.read(), filename=file_) + except SyntaxError: + continue NoneCoalesceIfBlockVisitor(file_, nci_callback).visit(tree) NoneCoalesceOrVisitor(file_, nco_callback).visit(tree)