Skip to content

Commit 7095545

Browse files
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 c0a0c64 commit 7095545

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

@@ -298,8 +299,11 @@ def run(self):
298299
class PydocTopicsBuilder(Builder):
299300
name = 'pydoc-topics'
300301

302+
default_translator_class = TextTranslator
303+
301304
def init(self):
302305
self.topics = {}
306+
self.secnumbers = {}
303307

304308
def get_outdated_docs(self):
305309
return 'all pydoc topics'
@@ -309,9 +313,9 @@ def get_target_uri(self, docname, typ=None):
309313

310314
def write(self, *ignored):
311315
writer = TextWriter(self)
312-
for label in self.status_iterator(pydoc_topic_labels,
313-
'building topics... ',
314-
length=len(pydoc_topic_labels)):
316+
for label in status_iterator(pydoc_topic_labels,
317+
'building topics... ',
318+
length=len(pydoc_topic_labels)):
315319
if label not in self.env.domaindata['std']['labels']:
316320
self.warn('label %r not in documentation' % label)
317321
continue

0 commit comments

Comments
 (0)