[Python-checkins] [3.11] Do not use deprecated ``logger.warn()`` in pyspecific (GH-107694) (#107696)

AlexWaygood webhook-mailer at python.org
Sun Aug 6 10:06:19 EDT 2023


https://github.com/python/cpython/commit/2345a8fb0c8e660e2e3d63697e16433a312fce58
commit: 2345a8fb0c8e660e2e3d63697e16433a312fce58
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: AlexWaygood <Alex.Waygood at Gmail.com>
date: 2023-08-06T14:06:16Z
summary:

[3.11] Do not use deprecated ``logger.warn()`` in pyspecific (GH-107694) (#107696)

Do not use deprecated ``logger.warn()`` in pyspecific (GH-107694)
(cherry picked from commit 9564e31cbc95a723f2414537231bc4611b56644f)

Co-authored-by: Adam Turner <9087854+AA-Turner at users.noreply.github.com>

files:
M Doc/tools/extensions/pyspecific.py

diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py
index 9104be01b722e..f59331419e508 100644
--- a/Doc/tools/extensions/pyspecific.py
+++ b/Doc/tools/extensions/pyspecific.py
@@ -185,7 +185,7 @@ def parse_platforms(self):
         if unknown:
             cls = type(self)
             logger = logging.getLogger(cls.__qualname__)
-            logger.warn(
+            logger.warning(
                 f"Unknown platform(s) or syntax '{' '.join(sorted(unknown))}' "
                 f"in '.. availability:: {self.arguments[0]}', see "
                 f"{__file__}:{cls.__qualname__}.known_platforms for a set "
@@ -272,7 +272,7 @@ def run(self):
         info = env.all_audit_events.setdefault(name, new_info)
         if info is not new_info:
             if not self._do_args_match(info['args'], new_info['args']):
-                self.logger.warn(
+                self.logger.warning(
                     "Mismatched arguments for audit-event {}: {!r} != {!r}"
                     .format(name, info['args'], new_info['args'])
                 )
@@ -549,7 +549,7 @@ def write(self, *ignored):
                                      'building topics... ',
                                      length=len(pydoc_topic_labels)):
             if label not in self.env.domaindata['std']['labels']:
-                self.env.logger.warn('label %r not in documentation' % label)
+                self.env.logger.warning(f'label {label!r} not in documentation')
                 continue
             docname, labelid, sectname = self.env.domaindata['std']['labels'][label]
             doctree = self.env.get_and_resolve_doctree(docname, self)



More information about the Python-checkins mailing list