diff --git a/CHANGES b/CHANGES index 1cd9f82b6..8ac344859 100644 --- a/CHANGES +++ b/CHANGES @@ -25,6 +25,7 @@ Bugs fixed * #3835: sphinx.ext.imgmath fails to convert SVG images if project directory name contains spaces * #3850: Fix color handling in make mode's help command +* #3865: use of self.env.warn in sphinx extension fails Testing -------- diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py index 1c47b4b3e..ab6414f3b 100644 --- a/sphinx/environment/__init__.py +++ b/sphinx/environment/__init__.py @@ -300,8 +300,7 @@ class BuildEnvironment(object): be emitted instantly, but collected for emitting all warnings after the update of the environment. """ - # strange argument order is due to backwards compatibility - self._warnfunc(msg, (docname, lineno), **kwargs) + self.app.warn(msg, location=(docname, lineno), **kwargs) def warn_node(self, msg, node, **kwargs): # type: (unicode, nodes.Node, Any) -> None