diff options
Diffstat (limited to 'sphinx/ext/mathbase.py')
-rw-r--r-- | sphinx/ext/mathbase.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py index 076edaf37..2c37ba65a 100644 --- a/sphinx/ext/mathbase.py +++ b/sphinx/ext/mathbase.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- """ sphinx.ext.mathbase ~~~~~~~~~~~~~~~~~~~ @@ -24,8 +23,8 @@ from sphinx.domains.math import MathReferenceRole as EqXRefRole # NOQA # to ke if False: # For type annotation from typing import Any, Callable, List, Tuple # NOQA - from docutils.writers.html4css1 import Writer # NOQA from sphinx.application import Sphinx # NOQA + from sphinx.writers.html import HTMLTranslator # NOQA class MathDirective(MathDirectiveBase): @@ -33,7 +32,7 @@ class MathDirective(MathDirectiveBase): warnings.warn('sphinx.ext.mathbase.MathDirective is moved to ' 'sphinx.directives.patches package.', RemovedInSphinx30Warning, stacklevel=2) - return super(MathDirective, self).run() + return super().run() def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]): @@ -44,7 +43,7 @@ def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]): def get_node_equation_number(writer, node): - # type: (Writer, nodes.Node) -> unicode + # type: (HTMLTranslator, nodes.math_block) -> str warnings.warn('sphinx.ext.mathbase.get_node_equation_number() is moved to ' 'sphinx.util.math package.', RemovedInSphinx30Warning, stacklevel=2) @@ -53,7 +52,7 @@ def get_node_equation_number(writer, node): def wrap_displaymath(text, label, numbering): - # type: (unicode, unicode, bool) -> unicode + # type: (str, str, bool) -> str warnings.warn('sphinx.ext.mathbase.wrap_displaymath() is moved to ' 'sphinx.util.math package.', RemovedInSphinx30Warning, stacklevel=2) @@ -62,7 +61,7 @@ def wrap_displaymath(text, label, numbering): def is_in_section_title(node): - # type: (nodes.Node) -> bool + # type: (nodes.Element) -> bool """Determine whether the node is in a section title""" from sphinx.util.nodes import traverse_parent |