Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip files that raise RecursionError #304

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "refurb"
version = "1.22.1"
version = "1.22.2"
description = "A tool for refurbish and modernize Python codebases"
authors = ["dosisod"]
license = "GPL-3.0-only"
Expand Down
6 changes: 5 additions & 1 deletion refurb/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import re
import time
from collections.abc import Sequence
from contextlib import suppress
from functools import cache, partial
from importlib import metadata
from io import StringIO
Expand Down Expand Up @@ -189,7 +190,10 @@ def run_refurb(settings: Settings) -> Sequence[Error | str]:
start = time.time()

visitor = RefurbVisitor(checks, settings)
tree.accept(visitor)

# See: https://github.com/dosisod/refurb/issues/302
with suppress(RecursionError):
tree.accept(visitor)

elapsed = time.time() - start

Expand Down
Loading