diff options
author | Anthony Sottile <asottile@umich.edu> | 2019-02-03 15:22:52 -0800 |
---|---|---|
committer | Ned Deily <nad@python.org> | 2019-02-03 18:22:52 -0500 |
commit | 9bacdce451618a5f0bf62cb1b6f966ebde0492c6 (patch) | |
tree | 22457c3c606a16d8be8f1b73c863915fd3f069d1 | |
parent | bpo-35486: Note Py3.6 import system API requirement change (GH-11540) (GH-11588) (diff) | |
download | cpython-9bacdce451618a5f0bf62cb1b6f966ebde0492c6.tar.gz cpython-9bacdce451618a5f0bf62cb1b6f966ebde0492c6.tar.bz2 cpython-9bacdce451618a5f0bf62cb1b6f966ebde0492c6.zip |
[3.6] bpo-35605: Fix documentation build for sphinx<1.6 (GH-11368)
-rw-r--r-- | Doc/tools/extensions/escape4chm.py | 5 | ||||
-rw-r--r-- | Doc/tools/extensions/pyspecific.py | 6 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Documentation/2018-12-30-09-56-13.bpo-35605.gAWt32.rst | 1 |
3 files changed, 10 insertions, 2 deletions
diff --git a/Doc/tools/extensions/escape4chm.py b/Doc/tools/extensions/escape4chm.py index e9999716251..68d4e77a371 100644 --- a/Doc/tools/extensions/escape4chm.py +++ b/Doc/tools/extensions/escape4chm.py @@ -8,7 +8,10 @@ https://bugs.python.org/issue32174 import re from html.entities import codepoint2name -from sphinx.util.logging import getLogger +try: # sphinx>=1.6 + from sphinx.util.logging import getLogger +except ImportError: # sphinx<1.6 + from logging import getLogger # escape the characters which codepoint > 0x7F def _process(string): diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index dec7f0c779a..70bdd175424 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -23,7 +23,6 @@ from docutils import nodes, utils 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, TextTranslator @@ -314,6 +313,11 @@ class PydocTopicsBuilder(Builder): return '' # no URIs 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) for label in status_iterator(pydoc_topic_labels, 'building topics... ', diff --git a/Misc/NEWS.d/next/Documentation/2018-12-30-09-56-13.bpo-35605.gAWt32.rst b/Misc/NEWS.d/next/Documentation/2018-12-30-09-56-13.bpo-35605.gAWt32.rst new file mode 100644 index 00000000000..cbc0f1e07f3 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2018-12-30-09-56-13.bpo-35605.gAWt32.rst @@ -0,0 +1 @@ +Fix documentation build for sphinx<1.6. Patch by Anthony Sottile. |