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)
commit875df20e8a2a9bad07a42f0175be019d915e0845 (patch)
treee1e6b9db6c30cf52d99e36b4f6becaba4ff37315 /Lib/inspect.py
parent374375dd26118ccb7027f66d66ab9e80c82f4103 (diff)
downloadcpython-875df20e8a2a9bad07a42f0175be019d915e0845.zip
cpython-875df20e8a2a9bad07a42f0175be019d915e0845.tar.gz
cpython-875df20e8a2a9bad07a42f0175be019d915e0845.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 05d67fc..fdb5e2a 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -1210,7 +1210,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