]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix 3.6 documentation build for sphinx<1.6 (GH-14576)
authorAnthony Sottile <asottile@umich.edu>
Wed, 3 Jul 2019 22:39:49 +0000 (18:39 -0400)
committerNed Deily <nad@python.org>
Wed, 3 Jul 2019 22:39:48 +0000 (18:39 -0400)
Doc/tools/extensions/suspicious.py

index 8d80f6759bffd4354a24d4dc288927ce1fbf2e4f..dfcd0da9fdbda5dadbd49803972da5c0a580a693 100644 (file)
@@ -50,6 +50,12 @@ from docutils import nodes
 from sphinx.builders import Builder
 import sphinx.util
 
+try:  # sphinx>=1.6
+    from sphinx.util.logging import getLogger
+except ImportError:  # sphinx<1.6
+    from logging import getLogger
+
+
 detect_all = re.compile(r'''
     ::(?=[^=])|            # two :: (but NOT ::=)
     :[a-zA-Z][a-zA-Z0-9]+| # :foo
@@ -86,7 +92,7 @@ class CheckSuspiciousMarkupBuilder(Builder):
     Checks for possibly invalid markup that may leak into the output.
     """
     name = 'suspicious'
-    logger = sphinx.util.logging.getLogger("CheckSuspiciousMarkupBuilder")
+    logger = getLogger("CheckSuspiciousMarkupBuilder")
 
     def init(self):
         # create output file