Commit 7d196762 authored by Benjamin Peterson's avatar Benjamin Peterson Committed by GitHub

[2.7] fix pydoc-topics to work with Sphinx 1.7 (GH-6502)

In fact, we now require a newer Sphinx version because APIs have moved around..
(cherry picked from commit acfb087f)
parent bad9a580
......@@ -15,9 +15,11 @@ SOURCE_URI = 'https://github.com/python/cpython/tree/2.7/%s'
from docutils import nodes, utils
from docutils.parsers.rst import Directive
from sphinx.util import status_iterator
from sphinx.util.nodes import split_explicit_title
from sphinx.writers.html import HTMLTranslator
from sphinx.writers.latex import LaTeXTranslator
from sphinx.writers.text import TextTranslator
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
from docutils.parsers.rst.states import Body
......@@ -158,8 +160,11 @@ from sphinx.writers.text import TextWriter
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'
......@@ -169,7 +174,7 @@ class PydocTopicsBuilder(Builder):
def write(self, *ignored):
writer = TextWriter(self)
for label in self.status_iterator(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']:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment