diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-05-15 13:00:49 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-05-15 14:24:32 +0200 |
commit | b741a793e63c0fd4a333cd575ac2339f5a9b2698 (patch) | |
tree | ee7944dbe35bb6f1bbb87baa014db594e76b634c | |
parent | b8fad4bcd02210912de8cbdefcd77e9ca743a575 (diff) | |
download | sparse-b741a793e63c0fd4a333cd575ac2339f5a9b2698.tar.gz |
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 <luc.vanoostenryck@gmail.com>
-rwxr-xr-x | Documentation/sphinx/cdoc.py | 10 |
1 files 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, '<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): |