mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
inspect: Fix getcallargs() to fail correctly if more than 3 args are missing.
Patch by Jeremiah Lowin. Closes #20817.
This commit is contained in:
parent
b1d060bf8b
commit
2542b66bb0
3 changed files with 10 additions and 1 deletions
|
@ -1125,7 +1125,7 @@ def _missing_arguments(f_name, argnames, pos, values):
|
|||
elif missing == 2:
|
||||
s = "{} and {}".format(*names)
|
||||
else:
|
||||
tail = ", {} and {}".format(names[-2:])
|
||||
tail = ", {} and {}".format(*names[-2:])
|
||||
del names[-2:]
|
||||
s = ", ".join(names) + tail
|
||||
raise TypeError("%s() missing %i required %s argument%s: %s" %
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue