summaryrefslogtreecommitdiff
path: root/sphinx/ext/mathbase.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-10-15 00:33:19 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-10-17 02:05:07 +0900
commit257394a4592b4b4f317059fec9938877301c2893 (patch)
tree9dc85b7486b59668ba8a64984c6aa70aadc2f1ed /sphinx/ext/mathbase.py
parentc584b71b128e2ddc0fa1d7f76bbe68217cc64c50 (diff)
downloadsphinx-git-257394a4592b4b4f317059fec9938877301c2893.tar.gz
Fix #5471: Show appropriate warning for deprecated APIs
Diffstat (limited to 'sphinx/ext/mathbase.py')
-rw-r--r--sphinx/ext/mathbase.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py
index 421ea6a03..076edaf37 100644
--- a/sphinx/ext/mathbase.py
+++ b/sphinx/ext/mathbase.py
@@ -32,14 +32,14 @@ class MathDirective(MathDirectiveBase):
def run(self):
warnings.warn('sphinx.ext.mathbase.MathDirective is moved to '
'sphinx.directives.patches package.',
- RemovedInSphinx30Warning)
+ RemovedInSphinx30Warning, stacklevel=2)
return super(MathDirective, self).run()
def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
warnings.warn('sphinx.ext.mathbase.math_role() is deprecated. '
'Please use docutils.parsers.rst.roles.math_role() instead.',
- RemovedInSphinx30Warning)
+ RemovedInSphinx30Warning, stacklevel=2)
return math_role_base(role, rawtext, text, lineno, inliner, options, content)
@@ -47,7 +47,7 @@ def get_node_equation_number(writer, node):
# type: (Writer, nodes.Node) -> unicode
warnings.warn('sphinx.ext.mathbase.get_node_equation_number() is moved to '
'sphinx.util.math package.',
- RemovedInSphinx30Warning)
+ RemovedInSphinx30Warning, stacklevel=2)
from sphinx.util.math import get_node_equation_number
return get_node_equation_number(writer, node)
@@ -56,7 +56,7 @@ def wrap_displaymath(text, label, numbering):
# type: (unicode, unicode, bool) -> unicode
warnings.warn('sphinx.ext.mathbase.wrap_displaymath() is moved to '
'sphinx.util.math package.',
- RemovedInSphinx30Warning)
+ RemovedInSphinx30Warning, stacklevel=2)
from sphinx.util.math import wrap_displaymath
return wrap_displaymath(text, label, numbering)
@@ -67,7 +67,7 @@ def is_in_section_title(node):
from sphinx.util.nodes import traverse_parent
warnings.warn('is_in_section_title() is deprecated.',
- RemovedInSphinx30Warning)
+ RemovedInSphinx30Warning, stacklevel=2)
for ancestor in traverse_parent(node):
if isinstance(ancestor, nodes.title) and \
@@ -80,6 +80,6 @@ def setup_math(app, htmlinlinevisitors, htmldisplayvisitors):
# type: (Sphinx, Tuple[Callable, Callable], Tuple[Callable, Callable]) -> None
warnings.warn('setup_math() is deprecated. '
'Please use app.add_html_math_renderer() instead.',
- RemovedInSphinx30Warning)
+ RemovedInSphinx30Warning, stacklevel=2)
app.add_html_math_renderer('unknown', htmlinlinevisitors, htmldisplayvisitors)