Skip to content

Commit 5f0d9e6

Browse files
committed
fix: Increase maximum recursion limit when calling as a CLI
Issue-402: #402
1 parent 266be2d commit 5f0d9e6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/griffe/_internal/cli.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,9 @@ def main(args: list[str] | None = None) -> int:
563563
else:
564564
logging.basicConfig(format="%(levelname)-10s %(message)s", level=level)
565565

566+
# Increase maximum recursion limit to 2000.
567+
sys.setrecursionlimit(max(2000, sys.getrecursionlimit()))
568+
566569
# Run subcommand.
567570
commands: dict[str, Callable[..., int]] = {"check": check, "dump": dump}
568571
return commands[subcommand](**opts_dict)

0 commit comments

Comments
 (0)