fix: handle RecursionError during tree traversal in linter

This commit is contained in:
Paul Gauthier 2024-10-31 14:55:54 -07:00 committed by Paul Gauthier (aider)
parent 3794cf941f
commit af7aaad903

View file

@ -221,7 +221,12 @@ def basic_lint(fname, code):
tree = parser.parse(bytes(code, "utf-8"))
errors = traverse_tree(tree.root_node)
try:
errors = traverse_tree(tree.root_node)
except RecursionError:
print(f"Unable to lint {fname} due to RecursionError")
return
if not errors:
return