summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-01-17 04:15:01 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-01-17 04:15:01 (GMT)
commit9953a8dfd6b078b58a7c73991660537677d11b56 (patch)
tree2d436fb4412751395ad065101f75cfa1f31806df /Lib/inspect.py
parentc10c34d6cb0d06632c7706a16cb3d448e0c3cfce (diff)
downloadcpython-9953a8dfd6b078b58a7c73991660537677d11b56.zip
cpython-9953a8dfd6b078b58a7c73991660537677d11b56.tar.gz
cpython-9953a8dfd6b078b58a7c73991660537677d11b56.tar.bz2
fix inspect.formatargspec on functions with keyword-only arguments without defaults #4959
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 b84aec0..45515fc 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -894,7 +894,7 @@ def formatargspec(args, varargs=None, varkw=None, defaults=None,
if kwonlyargs:
for kwonlyarg in kwonlyargs:
spec = formatargandannotation(kwonlyarg)
- if kwonlyarg in kwonlydefaults:
+ if kwonlydefaults and kwonlyarg in kwonlydefaults:
spec += formatvalue(kwonlydefaults[kwonlyarg])
specs.append(spec)
if varkw is not None: