Skip to content

Commit

Permalink
Use narrower [method-assign] instead of [assignment] (mypy 1.1.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu committed Mar 7, 2023
1 parent c499e09 commit f8a5183
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sphinx/util/docutils.py
Expand Up @@ -217,15 +217,15 @@ def depart_footnote(self, node):
# Only apply on Docutils 0.18 or 0.18.1, as 0.17 and earlier used a <dl> based
# approach, and 0.19 and later use the fixed approach by default.
if docutils.__version_info__[:2] == (0, 18):
HTMLTranslator.visit_footnote = visit_footnote # type: ignore[assignment]
HTMLTranslator.depart_footnote = depart_footnote # type: ignore[assignment]
HTMLTranslator.visit_footnote = visit_footnote # type: ignore[method-assign]
HTMLTranslator.depart_footnote = depart_footnote # type: ignore[method-assign]

try:
yield
finally:
if docutils.__version_info__[:2] == (0, 18):
HTMLTranslator.visit_footnote = old_visit_footnote # type: ignore[assignment]
HTMLTranslator.depart_footnote = old_depart_footnote # type: ignore[assignment]
HTMLTranslator.visit_footnote = old_visit_footnote # type: ignore[method-assign]
HTMLTranslator.depart_footnote = old_depart_footnote # type: ignore[method-assign]


@contextmanager
Expand Down

0 comments on commit f8a5183

Please sign in to comment.