Skip to content

Commit aaf01bf

Browse files
authored
Merge pull request #25073 from Carreau/log-f
MAINT: don't format logs in log call.
2 parents 66f7956 + 9fceadf commit aaf01bf

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

doc/sphinxext/redirect_from.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ def _generate_redirects(app, exception):
112112
html = HTML_TEMPLATE.format(v=builder.get_relative_uri(k, v))
113113
if p.is_file():
114114
if p.read_text() != html:
115-
logger.warning(f'A redirect-from directive is trying to '
116-
f'create {p}, but that file already exists '
117-
f'(perhaps you need to run "make clean")')
115+
logger.warning('A redirect-from directive is trying to '
116+
'create %s, but that file already exists '
117+
'(perhaps you need to run "make clean")', p)
118118
else:
119-
logger.info(f'making refresh html file: {k} redirect to {v}')
119+
logger.info('making refresh html file: %s redirect to %s', k, v)
120120
p.parent.mkdir(parents=True, exist_ok=True)
121121
p.write_text(html, encoding='utf-8')

lib/matplotlib/_afm.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def _parse_header(fh):
154154
try:
155155
converter = header_converters[key]
156156
except KeyError:
157-
_log.error('Found an unknown keyword in AFM header (was %r)' % key)
157+
_log.error("Found an unknown keyword in AFM header (was %r)", key)
158158
continue
159159
try:
160160
d[key] = converter(val)

lib/matplotlib/_mathtext.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ def _get_glyph(self, fontname, font_class, sym):
530530
except ValueError:
531531
uniindex = ord('?')
532532
found_symbol = False
533-
_log.warning(f"No TeX to Unicode mapping for {sym!a}.")
533+
_log.warning("No TeX to Unicode mapping for %a.", sym)
534534

535535
fontname, uniindex = self._map_virtual_font(
536536
fontname, font_class, uniindex)
@@ -576,9 +576,9 @@ def _get_glyph(self, fontname, font_class, sym):
576576
if (fontname in ('it', 'regular')
577577
and isinstance(self, StixFonts)):
578578
return self._get_glyph('rm', font_class, sym)
579-
_log.warning(f"Font {new_fontname!r} does not have a glyph "
580-
f"for {sym!a} [U+{uniindex:x}], substituting "
581-
"with a dummy symbol.")
579+
_log.warning("Font %r does not have a glyph for %a [U+%x], "
580+
"substituting with a dummy symbol.",
581+
new_fontname, sym, uniindex)
582582
font = self._get_font('rm')
583583
uniindex = 0xA4 # currency char, for lack of anything better
584584
slanted = False

lib/matplotlib/backends/backend_webagg_core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def handle_event(self, event):
266266
return handler(event)
267267

268268
def handle_unknown_event(self, event):
269-
_log.warning(f'Unhandled message type {event["type"]}. {event}')
269+
_log.warning('Unhandled message type %s. %s', event["type"], event)
270270

271271
def handle_ack(self, event):
272272
# Network latency tends to decrease if traffic is flowing

lib/matplotlib/font_manager.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ def json_dump(data, filename):
958958
try:
959959
json.dump(data, fh, cls=_JSONEncoder, indent=2)
960960
except OSError as e:
961-
_log.warning(f'Could not save font_manager cache {e}')
961+
_log.warning('Could not save font_manager cache %s', e)
962962

963963

964964
def json_load(filename):

0 commit comments

Comments
 (0)