Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit daab0fc

Browse filesBrowse files
timhoffmmeeseeksmachine
authored andcommitted
Backport PR #16613: Fix edge-case in preprocess_data, if label_namer is optional and unset.
1 parent 5411431 commit daab0fc
Copy full SHA for daab0fc

File tree

Expand file treeCollapse file tree

1 file changed

+3
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-8
lines changed

‎lib/matplotlib/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/__init__.py
+3-8Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,9 +1543,6 @@ def inner(ax, *args, data=None, **kwargs):
15431543
return func(ax, *map(sanitize_sequence, args), **kwargs)
15441544

15451545
bound = new_sig.bind(ax, *args, **kwargs)
1546-
needs_label = (label_namer
1547-
and "label" not in bound.arguments
1548-
and "label" not in bound.kwargs)
15491546
auto_label = (bound.arguments.get(label_namer)
15501547
or bound.kwargs.get(label_namer))
15511548

@@ -1564,12 +1561,10 @@ def inner(ax, *args, data=None, **kwargs):
15641561
new_args = bound.args
15651562
new_kwargs = bound.kwargs
15661563

1567-
if needs_label:
1568-
all_kwargs = {**bound.arguments, **bound.kwargs}
1569-
# label_namer will be in all_kwargs as we asserted above that
1570-
# `label_namer is None or label_namer in arg_names`.
1564+
args_and_kwargs = {**bound.arguments, **bound.kwargs}
1565+
if label_namer and "label" not in args_and_kwargs:
15711566
new_kwargs["label"] = _label_from_arg(
1572-
all_kwargs[label_namer], auto_label)
1567+
args_and_kwargs.get(label_namer), auto_label)
15731568

15741569
return func(*new_args, **new_kwargs)
15751570

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.