[Python-checkins] fix pydoc-topics to work with Sphinx 1.7 (GH-6475)

Miss Islington (bot) webhook-mailer at python.org
Tue Apr 17 02:32:46 EDT 2018


https://github.com/python/cpython/commit/7899153c1f9e6808c7729200f62ab2a70cfa9427
commit: 7899153c1f9e6808c7729200f62ab2a70cfa9427
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018年04月16日T23:32:43-07:00
summary:
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 acfb087f9f5590e5174a30eced3c2fe911f49d70)
Co-authored-by: Benjamin Peterson <benjamin at python.org>
files:
M Doc/tools/extensions/pyspecific.py
diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py
index bb69366ecd49..92506e7b3270 100644
--- a/Doc/tools/extensions/pyspecific.py
+++ b/Doc/tools/extensions/pyspecific.py
@@ -23,9 +23,10 @@
 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 @@ def run(self):
 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 @@ def get_target_uri(self, docname, typ=None):
 
 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


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /