summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2014-03-27 22:23:03 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2014-03-27 22:23:03 (GMT)
commitb1d060bf8b017d2a6cf6a0191b1451aeb27a5c03 (patch)
treee19a16da6d5952ecc45403722cc6f3d751320a8b /Lib/inspect.py
parent00abf385ac3b4b13aee66cbeb2a33604d8a871f5 (diff)
downloadcpython-b1d060bf8b017d2a6cf6a0191b1451aeb27a5c03.zip
cpython-b1d060bf8b017d2a6cf6a0191b1451aeb27a5c03.tar.gz
cpython-b1d060bf8b017d2a6cf6a0191b1451aeb27a5c03.tar.bz2
inspect: Fix getcallargs() to raise correct TypeError
... for missing keyword-only arguments. Patch by Jeremiah Lowin. Closes #20816.
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index c7a2cf8..06057af 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -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