Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/matplotlib/_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,14 @@ def my_func(*args, **kwargs):
# Rather than relying on locals() ordering, one could have just used func's
# signature (``bound = inspect.signature(func).bind(*args, **kwargs);
# bound.apply_defaults(); return bound``) but that is significantly slower.
for i, func in enumerate(funcs):
last_exception = None
for func in funcs:
try:
return func(*args, **kwargs)
except TypeError:
if i == len(funcs) - 1:
raise
except TypeError as exc:
last_exception = exc
if last_exception is not None:
raise last_exception


def nargs_error(name, takes, given):
Expand Down