summaryrefslogtreecommitdiffstats
path: root/Doc/tools
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2018-10-15 19:07:23 (GMT)
committerGitHub <noreply@github.com>2018-10-15 19:07:23 (GMT)
commitee171a26c1169abfae534b08acc0d95c6e45a22a (patch)
tree8d3ec35c87336cf25cc4dc61db68687565570d06 /Doc/tools
parent6bdb6f7675922e601e742758c7c240a751fd365b (diff)
downloadcpython-ee171a26c1169abfae534b08acc0d95c6e45a22a.zip
cpython-ee171a26c1169abfae534b08acc0d95c6e45a22a.tar.gz
cpython-ee171a26c1169abfae534b08acc0d95c6e45a22a.tar.bz2
Stop using deprecated logging API in Sphinx suspicious checker (GH-9875)
Diffstat (limited to 'Doc/tools')
-rw-r--r--Doc/tools/extensions/suspicious.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Doc/tools/extensions/suspicious.py b/Doc/tools/extensions/suspicious.py
index 0a70e57..8d80f67 100644
--- a/Doc/tools/extensions/suspicious.py
+++ b/Doc/tools/extensions/suspicious.py
@@ -48,6 +48,7 @@ import sys
from docutils import nodes
from sphinx.builders import Builder
+import sphinx.util
detect_all = re.compile(r'''
::(?=[^=])| # two :: (but NOT ::=)
@@ -85,6 +86,7 @@ class CheckSuspiciousMarkupBuilder(Builder):
Checks for possibly invalid markup that may leak into the output.
"""
name = 'suspicious'
+ logger = sphinx.util.logging.getLogger("CheckSuspiciousMarkupBuilder")
def init(self):
# create output file
@@ -116,7 +118,7 @@ class CheckSuspiciousMarkupBuilder(Builder):
self.warn('Found %s/%s unused rules:' %
(len(unused_rules), len(self.rules)))
for rule in unused_rules:
- self.info(repr(rule))
+ self.logger.info(repr(rule))
return
def check_issue(self, line, lineno, issue):
@@ -146,7 +148,7 @@ class CheckSuspiciousMarkupBuilder(Builder):
return False
def report_issue(self, text, lineno, issue):
- if not self.any_issue: self.info()
+ if not self.any_issue: self.logger.info()
self.any_issue = True
self.write_log_entry(lineno, issue, text)
if py3:
@@ -181,7 +183,7 @@ class CheckSuspiciousMarkupBuilder(Builder):
A csv file, with exactly the same format as suspicious.csv
Fields: document name (normalized), line number, issue, surrounding text
"""
- self.info("loading ignore rules... ", nonl=1)
+ self.logger.info("loading ignore rules... ", nonl=1)
self.rules = rules = []
try:
if py3:
@@ -206,7 +208,7 @@ class CheckSuspiciousMarkupBuilder(Builder):
rule = Rule(docname, lineno, issue, text)
rules.append(rule)
f.close()
- self.info('done, %d rules loaded' % len(self.rules))
+ self.logger.info('done, %d rules loaded' % len(self.rules))
def get_lineno(node):