[3.6] bpo-35605: Fix documentation build for sphinx<1.6 (GH-11368) · python/cpython@9bacdce (original) (raw)
File tree
3 files changed
lines changed
- Misc/NEWS.d/next/Documentation
3 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -8,7 +8,10 @@ | ||
8 | 8 | import re |
9 | 9 | from html.entities import codepoint2name |
10 | 10 | |
11 | -from sphinx.util.logging import getLogger | |
11 | +try: # sphinx>=1.6 | |
12 | +from sphinx.util.logging import getLogger | |
13 | +except ImportError: # sphinx<1.6 | |
14 | +from logging import getLogger | |
12 | 15 | |
13 | 16 | # escape the characters which codepoint > 0x7F |
14 | 17 | def _process(string): |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -23,7 +23,6 @@ | ||
23 | 23 | from sphinx import addnodes |
24 | 24 | from sphinx.builders import Builder |
25 | 25 | from sphinx.locale import translators |
26 | -from sphinx.util import status_iterator | |
27 | 26 | from sphinx.util.nodes import split_explicit_title |
28 | 27 | from sphinx.writers.html import HTMLTranslator |
29 | 28 | from sphinx.writers.text import TextWriter, TextTranslator |
@@ -314,6 +313,11 @@ def get_target_uri(self, docname, typ=None): | ||
314 | 313 | return '' # no URIs |
315 | 314 | |
316 | 315 | def write(self, *ignored): |
316 | +try: # sphinx>=1.6 | |
317 | +from sphinx.util import status_iterator | |
318 | +except ImportError: # sphinx<1.6 | |
319 | +status_iterator = self.status_iterator | |
320 | + | |
317 | 321 | writer = TextWriter(self) |
318 | 322 | for label in status_iterator(pydoc_topic_labels, |
319 | 323 | 'building topics... ', |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 | +Fix documentation build for sphinx<1.6. Patch by Anthony Sottile. |