Skip to content

Commit acfb087

Browse files
authored
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.
1 parent 4b685bf commit acfb087

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Doc/tools/extensions/pyspecific.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
from sphinx import addnodes
2424
from sphinx.builders import Builder
2525
from sphinx.locale import translators
26+
from sphinx.util import status_iterator
2627
from sphinx.util.nodes import split_explicit_title
2728
from sphinx.writers.html import HTMLTranslator
28-
from sphinx.writers.text import TextWriter
29+
from sphinx.writers.text import TextWriter, TextTranslator
2930
from sphinx.writers.latex import LaTeXTranslator
3031
from sphinx.domains.python import PyModulelevel, PyClassmember
3132

@@ -295,8 +296,11 @@ def run(self):
295296
class PydocTopicsBuilder(Builder):
296297
name = 'pydoc-topics'
297298

299+
default_translator_class = TextTranslator
300+
298301
def init(self):
299302
self.topics = {}
303+
self.secnumbers = {}
300304

301305
def get_outdated_docs(self):
302306
return 'all pydoc topics'
@@ -306,9 +310,9 @@ def get_target_uri(self, docname, typ=None):
306310

307311
def write(self, *ignored):
308312
writer = TextWriter(self)
309-
for label in self.status_iterator(pydoc_topic_labels,
310-
'building topics... ',
311-
length=len(pydoc_topic_labels)):
313+
for label in status_iterator(pydoc_topic_labels,
314+
'building topics... ',
315+
length=len(pydoc_topic_labels)):
312316
if label not in self.env.domaindata['std']['labels']:
313317
self.warn('label %r not in documentation' % label)
314318
continue

0 commit comments

Comments
 (0)