Skip to content

Commit

Permalink
Fix mypy checks failing in new types-docutils (#37858)
Browse files Browse the repository at this point in the history
The types-docutils clarify type of some objects returned.

(cherry picked from commit 5f4bf90)
  • Loading branch information
potiuk authored and ephraimbuddy committed Mar 7, 2024
1 parent 5d56a65 commit 0c8440e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/exts/substitution_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from sphinx.transforms.post_transforms.code import HighlightLanguageTransform

if TYPE_CHECKING:
from docutils.nodes import Node, system_message
from docutils.utils import SystemMessage
from sphinx.application import Sphinx

LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -86,7 +86,7 @@ def condition(node):
node.rawsource = node.astext()


def substitution_code_role(*args, **kwargs) -> tuple[list[Node], list[system_message]]:
def substitution_code_role(*args, **kwargs) -> tuple[list, list[SystemMessage]]:
"""Decorate an inline code so that SubstitutionCodeBlockTransform will notice it"""
[node], system_messages = code_role(*args, **kwargs)
node[_SUBSTITUTION_OPTION_NAME] = True
Expand Down

0 comments on commit 0c8440e

Please sign in to comment.