8000 Fix incorrect calls to warn_deprecated. · matplotlib/matplotlib@df3834e · GitHub
[go: up one dir, main page]

Skip to content

Commit df3834e

Browse files
committed
Fix incorrect calls to warn_deprecated.
1) `message` is keyword-only. 2) it's `%(since)s`, not `%(version)s`.
1 parent 30ee939 commit df3834e

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,11 +1167,11 @@ def remove_callback(self, func, *args, **kwargs):
11671167
"""
11681168
if args or kwargs:
11691169
cbook.warn_deprecated(
1170-
"3.1", "In a future version, Timer.remove_callback will not "
1171-
"take *args, **kwargs anymore, but remove all callbacks where "
1172-
"the callable matches; to keep a specific callback removable "
1173-
"by itself, pass it to add_callback as a functools.partial "
1174-
"object.")
1170+
"3.1", message="In a future version, Timer.remove_callback "
1171+
"will not take *args, **kwargs anymore, but remove all "
1172+
"callbacks where the callable matches; to keep a specific "
1173+
"callback removable by itself, pass it to add_callback as a "
1174+
"functools.partial object.")
11751175
self.callbacks.remove((func, args, kwargs))
11761176
else:
11771177
funcs = [c[0] for c in self.callbacks]

lib/matplotlib/offsetbox.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ def __init__(self, s, loc, pad=0.4, borderpad=0.5, prop=None, **kwargs):
13081308
cbook.warn_deprecated(
13091309
"3.1", message="Mixing horizontalalignment or "
13101310
"verticalalignment with AnchoredText is not supported, "
1311-
"deprecated since %(version)s, and will raise an exception "
1311+
"deprecated since %(since)s, and will raise an exception "
13121312
"%(removal)s.")
13131313

13141314
self.txt = TextArea(s, textprops=prop, minimumdescent=False)

lib/mpl_toolkits/axisartist/grid_finder.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ def _deprecate_factor_none(factor):
1010
# removed.
1111
if factor is None:
1212
cbook.warn_deprecated(
13-
"3.2", "factor=None is deprecated; use/return factor=1 instead")
13+
"3.2",
14+
message="factor=None is deprecated; use/return factor=1 instead")
1415
factor = 1
1516
return factor
1617

0 commit comments

Comments
 (0)
0