Skip to content

Commit c801129

Browse files
[3.12] Do not use deprecated logger.warn() in pyspecific (GH-107694) (#107695)
Do not use deprecated ``logger.warn()`` in pyspecific (GH-107694) (cherry picked from commit 9564e31) Co-authored-by: Adam Turner <[email protected]>
1 parent cc766c0 commit c801129

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
@@ -180,7 +180,7 @@ def parse_platforms(self):
180180
if unknown:
181181
cls = type(self)
182182
logger = logging.getLogger(cls.__qualname__)
183-
logger.warn(
183+
logger.warning(
184184
f"Unknown platform(s) or syntax '{' '.join(sorted(unknown))}' "
185185
f"in '.. availability:: {self.arguments[0]}', see "
186186
f"{__file__}:{cls.__qualname__}.known_platforms for a set "
@@ -267,7 +267,7 @@ def run(self):
267267
info = env.all_audit_events.setdefault(name, new_info)
268268
if info is not new_info:
269269
if not self._do_args_match(info['args'], new_info['args']):
270-
self.logger.warn(
270+
self.logger.warning(
271271
"Mismatched arguments for audit-event {}: {!r} != {!r}"
272272
.format(name, info['args'], new_info['args'])
273273
)
@@ -544,7 +544,7 @@ def write(self, *ignored):
544544
'building topics... ',
545545
length=len(pydoc_topic_labels)):
546546
if label not in self.env.domaindata['std']['labels']:
547-
self.env.logger.warn('label %r not in documentation' % label)
547+
self.env.logger.warning(f'label {label!r} not in documentation')
548548
continue
549549
docname, labelid, sectname = self.env.domaindata['std']['labels'][label]
550550
doctree = self.env.get_and_resolve_doctree(docname, self)

0 commit comments

Comments
 (0)