summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc/directive.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/ext/autodoc/directive.py')
-rw-r--r--sphinx/ext/autodoc/directive.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/sphinx/ext/autodoc/directive.py b/sphinx/ext/autodoc/directive.py
index 9a3428f5d..b4c5fd28d 100644
--- a/sphinx/ext/autodoc/directive.py
+++ b/sphinx/ext/autodoc/directive.py
@@ -2,7 +2,7 @@
sphinx.ext.autodoc.directive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
+ :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -16,7 +16,7 @@ from docutils.statemachine import StringList
from docutils.utils import Reporter, assemble_option_dict
from sphinx.config import Config
-from sphinx.deprecation import RemovedInSphinx40Warning
+from sphinx.deprecation import RemovedInSphinx40Warning, RemovedInSphinx50Warning
from sphinx.environment import BuildEnvironment
from sphinx.ext.autodoc import Documenter, Options
from sphinx.util import logging
@@ -55,7 +55,7 @@ class DocumenterBridge:
def __init__(self, env: BuildEnvironment, reporter: Reporter, options: Options,
lineno: int, state: Any = None) -> None:
self.env = env
- self.reporter = reporter
+ self._reporter = reporter
self.genopt = options
self.lineno = lineno
self.filename_set = set() # type: Set[str]
@@ -74,6 +74,12 @@ class DocumenterBridge:
def warn(self, msg: str) -> None:
logger.warning(msg, location=(self.env.docname, self.lineno))
+ @property
+ def reporter(self) -> Reporter:
+ warnings.warn('DocumenterBridge.reporter is deprecated.',
+ RemovedInSphinx50Warning, stacklevel=2)
+ return self._reporter
+
def process_documenter_options(documenter: "Type[Documenter]", config: Config, options: Dict
) -> Options: