]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] Do not use deprecated ``logger.warn()`` in pyspecific (GH-107694) (#107695)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 6 Aug 2023 14:17:20 +0000 (07:17 -0700)
committerGitHub <noreply@github.com>
Sun, 6 Aug 2023 14:17:20 +0000 (16:17 +0200)
Do not use deprecated ``logger.warn()`` in pyspecific (GH-107694)
(cherry picked from commit 9564e31cbc95a723f2414537231bc4611b56644f)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Doc/tools/extensions/pyspecific.py

index 003229d8a597547e3860f19956c7cfb331cb4f44..5ae742068e491efeb5a8da59120c1c5361aa0932 100644 (file)
@@ -180,7 +180,7 @@ class Availability(SphinxDirective):
         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 "
@@ -267,7 +267,7 @@ class AuditEvent(Directive):
         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'])
                 )
@@ -544,7 +544,7 @@ class PydocTopicsBuilder(Builder):
                                      '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)