inspect: Fix getcallargs() to fail correctly if more than 3 args are missing.

Patch by Jeremiah Lowin. Closes #20817.
This commit is contained in:
Yury Selivanov 2014-03-27 18:42:52 -04:00
parent b1d060bf8b
commit 2542b66bb0
3 changed files with 10 additions and 1 deletions

View file

@ -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" %