From cd064bdf6aca30aaf8ed82b68c609b4b68f21b26 Mon Sep 17 00:00:00 2001 From: M Bussonnier Date: Thu, 25 Apr 2024 00:11:08 -0700 Subject: [PATCH] MAINT: Fix some types (#1779) It look like one type annotation was incorrect --- src/pydata_sphinx_theme/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pydata_sphinx_theme/utils.py b/src/pydata_sphinx_theme/utils.py index 7b834f987..957ec618b 100644 --- a/src/pydata_sphinx_theme/utils.py +++ b/src/pydata_sphinx_theme/utils.py @@ -3,7 +3,7 @@ import copy import os import re -from typing import Any, Dict, Iterator, List, Optional, Union +from typing import Any, Callable, Dict, Iterable, List, Optional, Union from docutils.nodes import Node from sphinx.application import Sphinx @@ -32,7 +32,9 @@ def config_provided_by_user(app: Sphinx, key: str) -> bool: return any(key in ii for ii in [app.config.overrides, app.config._raw_config]) -def traverse_or_findall(node: Node, condition: str, **kwargs) -> Iterator[Node]: +def traverse_or_findall( + node: Node, condition: Union[Callable, type], **kwargs +) -> Iterable[Node]: """Triage node.traverse (docutils <0.18.1) vs node.findall. TODO: This check can be removed when the minimum supported docutils version