Skip to content

Commit ff01797

Browse files
committed
[2.7] 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.. (cherry picked from commit acfb087) Co-authored-by: Benjamin Peterson <[email protected]>
1 parent bad9a58 commit ff01797

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Doc/tools/extensions/pyspecific.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from docutils import nodes, utils
1616
from docutils.parsers.rst import Directive
1717

18+
from sphinx.util import status_iterator
1819
from sphinx.util.nodes import split_explicit_title
1920
from sphinx.writers.html import HTMLTranslator
2021
from sphinx.writers.latex import LaTeXTranslator
@@ -158,8 +159,11 @@ def run(self):
158159
class PydocTopicsBuilder(Builder):
159160
name = 'pydoc-topics'
160161

162+
default_translator_class = TextTranslator
163+
161164
def init(self):
162165
self.topics = {}
166+
self.secnumbers = {}
163167

164168
def get_outdated_docs(self):
165169
return 'all pydoc topics'
@@ -169,9 +173,9 @@ def get_target_uri(self, docname, typ=None):
169173

170174
def write(self, *ignored):
171175
writer = TextWriter(self)
172-
for label in self.status_iterator(pydoc_topic_labels,
173-
'building topics... ',
174-
length=len(pydoc_topic_labels)):
176+
for label in status_iterator(pydoc_topic_labels,
177+
'building topics... ',
178+
length=len(pydoc_topic_labels)):
175179
if label not in self.env.domaindata['std']['labels']:
176180
self.warn('label %r not in documentation' % label)
177181
continue

0 commit comments

Comments
 (0)