8000 Merge pull request #25863 from anntzer/ne · matplotlib/matplotlib@544d8ce · GitHub
[go: up one dir, main page]

Skip to content

Commit 544d8ce

Browse files
authored
Merge pull request #25863 from anntzer/ne
Fix incorrect usage of nargs_error.
2 parents 369cdb5 + c9b3a73 commit 544d8ce

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def legend(self, *args, **kwargs):
321321
*args,
322322
**kwargs)
323323
if len(extra_args):
324-
_api.nargs_error('legend', '0-2', len(args))
324+
raise _api.nargs_error('legend', '0-2', len(args))
325325
self.legend_ = mlegend.Legend(self, handles, labels, **kwargs)
326326
self.legend_._remove_method = self._remove_legend
327327
return self.legend_
@@ -3005,7 +3005,7 @@ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
30053005
which inspired this method.
30063006
"""
30073007
if not 1 <= len(args) <= 3:
3008-
_api.nargs_error('stem', '1-3', len(args))
3008+
raise _api.nargs_error('stem', '1-3', len(args))
30093009
_api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
30103010

30113011
if len(args) == 1:
@@ -6422,7 +6422,7 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
64226422
else:
64236423
raise TypeError("arguments do not match valid signatures")
64246424
else:
6425-
_api.nargs_error('pcolorfast', '1 or 3', len(args))
6425+
raise _api.nargs_error('pcolorfast', '1 or 3', len(args))
64266426

64276427
if style == "quadmesh":
64286428
# data point in each cell is value at lower left corner

lib/matplotlib/rcsetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ def cycler(*args, **kwargs):
687687
elif len(args) == 2:
688688
pairs = [(args[0], args[1])]
689689
elif len(args) > 2:
690-
_api.nargs_error('cycler', '0-2', len(args))
690+
raise _api.nargs_error('cycler', '0-2', len(args))
691691
else:
692692
pairs = kwargs.items()
693693

0 commit comments

Comments
 (0)
0