From b741a793e63c0fd4a333cd575ac2339f5a9b2698 Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Fri, 15 May 2020 13:00:49 +0200 Subject: doc: do not use obsolete sphinx.ext.autodoc.AutodocReporter sphinx.ext.autodoc.AutodocReporter is obsolete since Sphinx 1.7 and removed in some later versions. So, replace it by the code suggested in the release notes when it was obsoleted. Signed-off-by: Luc Van Oostenryck --- Documentation/sphinx/cdoc.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/sphinx/cdoc.py b/Documentation/sphinx/cdoc.py index 318e9b23..73c128cb 100755 --- a/Documentation/sphinx/cdoc.py +++ b/Documentation/sphinx/cdoc.py @@ -269,7 +269,7 @@ if __name__ == '__main__': dump_doc(extract(sys.stdin, '')) -from sphinx.ext.autodoc import AutodocReporter +from sphinx.util.docutils import switch_source_input import docutils import os class CDocDirective(docutils.parsers.rst.Directive): @@ -294,13 +294,13 @@ class CDocDirective(docutils.parsers.rst.Directive): ## let parse this new reST content memo = self.state.memo - save = memo.reporter, memo.title_styles, memo.section_level - memo.reporter = AutodocReporter(lst, memo.reporter) + save = memo.title_styles, memo.section_level node = docutils.nodes.section() try: - self.state.nested_parse(lst, 0, node, match_titles=1) + with switch_source_input(self.state, lst): + self.state.nested_parse(lst, 0, node, match_titles=1) finally: - memo.reporter, memo.title_styles, memo.section_level = save + memo.title_styles, memo.section_level = save return node.children def setup(app): -- cgit 1.2.3-korg