Skip files with syntax errors
This commit is contained in:
parent
2a4515c429
commit
e8d0ecf38f
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue