mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Use narrower [method-assign] instead of [assignment] (mypy 1.1.1)
This commit is contained in:
@@ -217,15 +217,15 @@ def du19_footnotes() -> Generator[None, None, None]:
|
|||||||
# Only apply on Docutils 0.18 or 0.18.1, as 0.17 and earlier used a <dl> based
|
# 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.
|
# approach, and 0.19 and later use the fixed approach by default.
|
||||||
if docutils.__version_info__[:2] == (0, 18):
|
if docutils.__version_info__[:2] == (0, 18):
|
||||||
HTMLTranslator.visit_footnote = visit_footnote # type: ignore[assignment]
|
HTMLTranslator.visit_footnote = visit_footnote # type: ignore[method-assign]
|
||||||
HTMLTranslator.depart_footnote = depart_footnote # type: ignore[assignment]
|
HTMLTranslator.depart_footnote = depart_footnote # type: ignore[method-assign]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
yield
|
yield
|
||||||
finally:
|
finally:
|
||||||
if docutils.__version_info__[:2] == (0, 18):
|
if docutils.__version_info__[:2] == (0, 18):
|
||||||
HTMLTranslator.visit_footnote = old_visit_footnote # type: ignore[assignment]
|
HTMLTranslator.visit_footnote = old_visit_footnote # type: ignore[method-assign]
|
||||||
HTMLTranslator.depart_footnote = old_depart_footnote # type: ignore[assignment]
|
HTMLTranslator.depart_footnote = old_depart_footnote # type: ignore[method-assign]
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
|
|||||||
Reference in New Issue
Block a user