mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
inspect: Fix getcallargs() to raise correct TypeError
... for missing keyword-only arguments. Patch by Jeremiah Lowin. Closes #20816.
This commit is contained in:
parent
00abf385ac
commit
b1d060bf8b
3 changed files with 12 additions and 1 deletions
|
@ -1208,7 +1208,7 @@ def getcallargs(*func_and_positional, **named):
|
|||
missing = 0
|
||||
for kwarg in kwonlyargs:
|
||||
if kwarg not in arg2value:
|
||||
if kwarg in kwonlydefaults:
|
||||
if kwonlydefaults and kwarg in kwonlydefaults:
|
||||
arg2value[kwarg] = kwonlydefaults[kwarg]
|
||||
else:
|
||||
missing += 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue