Skip to content

Commit 9bacdce

Browse files
asottilened-deily
authored andcommitted
[3.6] bpo-35605: Fix documentation build for sphinx<1.6 (GH-11368)
1 parent 1edb3dc commit 9bacdce

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Doc/tools/extensions/escape4chm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
import re
99
from html.entities import codepoint2name
1010

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
1215

1316
# escape the characters which codepoint > 0x7F
1417
def _process(string):

Doc/tools/extensions/pyspecific.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from sphinx import addnodes
2424
from sphinx.builders import Builder
2525
from sphinx.locale import translators
26-
from sphinx.util import status_iterator
2726
from sphinx.util.nodes import split_explicit_title
2827
from sphinx.writers.html import HTMLTranslator
2928
from sphinx.writers.text import TextWriter, TextTranslator
@@ -314,6 +313,11 @@ def get_target_uri(self, docname, typ=None):
314313
return '' # no URIs
315314

316315
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+
317321
writer = TextWriter(self)
318322
for label in status_iterator(pydoc_topic_labels,
319323
'building topics... ',
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix documentation build for sphinx<1.6. Patch by Anthony Sottile.

0 commit comments

Comments
 (0)