Skip to content

Commit 2345a8f

Browse files
[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 9564e31) Co-authored-by: Adam Turner <[email protected]>
1 parent 58b3161 commit 2345a8f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/tools/extensions/pyspecific.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def parse_platforms(self):
185185
if unknown:
186186
cls = type(self)
187187
logger = logging.getLogger(cls.__qualname__)
188-
logger.warn(
188+
logger.warning(
189189
f"Unknown platform(s) or syntax '{' '.join(sorted(unknown))}' "
190190
f"in '.. availability:: {self.arguments[0]}', see "
191191
f"{__file__}:{cls.__qualname__}.known_platforms for a set "
@@ -272,7 +272,7 @@ def run(self):
272272
info = env.all_audit_events.setdefault(name, new_info)
273273
if info is not new_info:
274274
if not self._do_args_match(info['args'], new_info['args']):
275-
self.logger.warn(
275+
self.logger.warning(
276276
"Mismatched arguments for audit-event {}: {!r} != {!r}"
277277
.format(name, info['args'], new_info['args'])
278278
)
@@ -549,7 +549,7 @@ def write(self, *ignored):
549549
'building topics... ',
550550
length=len(pydoc_topic_labels)):
551551
if label not in self.env.domaindata['std']['labels']:
552-
self.env.logger.warn('label %r not in documentation' % label)
552+
self.env.logger.warning(f'label {label!r} not in documentation')
553553
continue
554554
docname, labelid, sectname = self.env.domaindata['std']['labels'][label]
555555
doctree = self.env.get_and_resolve_doctree(docname, self)

0 commit comments

Comments
 (0)