Skip to content

Commit 7329d6a

Browse files
stefmolintacaswell
andauthored
Incorporate suggested change.
Co-authored-by: Thomas A Caswell <[email protected]>
1 parent f57f30e commit 7329d6a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2336,11 +2336,6 @@ def _auto_format_str(fmt, value):
23362336
'0 or {}'
23372337
"""
23382338
try:
2339-
lbl = fmt % value
2340-
# when used in `Axes.bar_label()`` this doesn't always raise an error
2341-
# when the {}-style formatting should be used instead of %-style
2342-
if lbl == fmt:
2343-
raise TypeError
2344-
return lbl
2339+
return fmt % (value,)
23452340
except (TypeError, ValueError):
23462341
return fmt.format(value)

0 commit comments

Comments
 (0)