Skip to content

Commit c44c708

Browse files
committed
Merge branch 'main' into type-parameters
Please enter a commit message to explain why this merge is necessary,
2 parents 79966ca + 53507b5 commit c44c708

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/mkdocstrings_handlers/python/_internal/handler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ def get_handler(
410410
Returns:
411411
An instance of `PythonHandler`.
412412
"""
413+
# In rare cases, Griffe hits the recursion limit because of deeply-nested ASTs.
414+
# We therefore increase the limit here, once, before Griffe is used to collect or render stuff.
415+
sys.setrecursionlimit(max(sys.getrecursionlimit(), 2000))
416+
413417
base_dir = Path(tool_config.config_file_path or "./mkdocs.yml").parent
414418
if "inventories" not in handler_config and "import" in handler_config:
415419
warn("The 'import' key is renamed 'inventories' for the Python handler", FutureWarning, stacklevel=1)

tests/test_end_to_end.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
def _normalize_html(html: str) -> str:
2424
soup = bs4.BeautifulSoup(html, features="html.parser")
25-
html = soup.prettify() # type: ignore[assignment]
25+
html = soup.prettify()
2626
html = re.sub(r"\b(0x)[a-f0-9]+\b", r"\1...", html)
2727
html = re.sub(r"^(Build Date UTC ?:).+", r"\1...", html, flags=re.MULTILINE)
2828
html = re.sub(r"\b[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}\b", r"...", html)

0 commit comments

Comments
 (0)