diff options
author | Benjamin Peterson <benjamin@python.org> | 2018-04-17 05:56:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-17 05:56:46 (GMT) |
commit | acfb087f9f5590e5174a30eced3c2fe911f49d70 (patch) | |
tree | e3e7e843e5d427d61276172b421185a82054cf29 /Doc/tools | |
parent | 4b685bf7192fff48c8effeeae4f4d64f9420ec0f (diff) | |
download | cpython-acfb087f9f5590e5174a30eced3c2fe911f49d70.zip cpython-acfb087f9f5590e5174a30eced3c2fe911f49d70.tar.gz cpython-acfb087f9f5590e5174a30eced3c2fe911f49d70.tar.bz2 |
fix pydoc-topics to work with Sphinx 1.7 (GH-6475)
In fact, we now require a newer Sphinx version because APIs have moved around.
Diffstat (limited to 'Doc/tools')
-rw-r--r-- | Doc/tools/extensions/pyspecific.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 47d3823..b6618f9 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -23,9 +23,10 @@ from docutils import nodes, utils from sphinx import addnodes from sphinx.builders import Builder from sphinx.locale import translators +from sphinx.util import status_iterator from sphinx.util.nodes import split_explicit_title from sphinx.writers.html import HTMLTranslator -from sphinx.writers.text import TextWriter +from sphinx.writers.text import TextWriter, TextTranslator from sphinx.writers.latex import LaTeXTranslator from sphinx.domains.python import PyModulelevel, PyClassmember @@ -295,8 +296,11 @@ pydoc_topic_labels = [ class PydocTopicsBuilder(Builder): name = 'pydoc-topics' + default_translator_class = TextTranslator + def init(self): self.topics = {} + self.secnumbers = {} def get_outdated_docs(self): return 'all pydoc topics' @@ -306,9 +310,9 @@ class PydocTopicsBuilder(Builder): def write(self, *ignored): writer = TextWriter(self) - for label in self.status_iterator(pydoc_topic_labels, - 'building topics... ', - length=len(pydoc_topic_labels)): + for label in status_iterator(pydoc_topic_labels, + 'building topics... ', + length=len(pydoc_topic_labels)): if label not in self.env.domaindata['std']['labels']: self.warn('label %r not in documentation' % label) continue |