Commit 869652b4 authored by Julien Palard's avatar Julien Palard Committed by GitHub

[2.7] bpo-35605: Fix documentation build for sphinx<1.6 (GH-12413)

(cherry picked from commit dfc8fc15fa989acba3c372572e52bbcb5ab38a37)
parent 8c380e99
...@@ -57,7 +57,7 @@ templates_path = ['tools/templates'] ...@@ -57,7 +57,7 @@ templates_path = ['tools/templates']
# Custom sidebar templates, filenames relative to this file. # Custom sidebar templates, filenames relative to this file.
html_sidebars = { html_sidebars = {
'index': 'indexsidebar.html', 'index': ['indexsidebar.html'],
} }
# Additional templates that should be rendered to pages. # Additional templates that should be rendered to pages.
......
...@@ -15,7 +15,6 @@ SOURCE_URI = 'https://github.com/python/cpython/tree/2.7/%s' ...@@ -15,7 +15,6 @@ SOURCE_URI = 'https://github.com/python/cpython/tree/2.7/%s'
from docutils import nodes, utils from docutils import nodes, utils
from docutils.parsers.rst import Directive from docutils.parsers.rst import Directive
from sphinx.util import status_iterator
from sphinx.util.nodes import split_explicit_title from sphinx.util.nodes import split_explicit_title
from sphinx.writers.html import HTMLTranslator from sphinx.writers.html import HTMLTranslator
from sphinx.writers.latex import LaTeXTranslator from sphinx.writers.latex import LaTeXTranslator
...@@ -173,6 +172,11 @@ class PydocTopicsBuilder(Builder): ...@@ -173,6 +172,11 @@ class PydocTopicsBuilder(Builder):
return '' # no URIs return '' # no URIs
def write(self, *ignored): def write(self, *ignored):
try: # sphinx>=1.6
from sphinx.util import status_iterator
except ImportError: # sphinx<1.6
status_iterator = self.status_iterator
writer = TextWriter(self) writer = TextWriter(self)
for label in status_iterator(pydoc_topic_labels, for label in status_iterator(pydoc_topic_labels,
'building topics... ', 'building topics... ',
......
Fix documentation build for sphinx<1.6. Patch by Anthony Sottile.
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