diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-01-17 04:15:01 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-01-17 04:15:01 (GMT) |
commit | 9953a8dfd6b078b58a7c73991660537677d11b56 (patch) | |
tree | 2d436fb4412751395ad065101f75cfa1f31806df /Lib/inspect.py | |
parent | c10c34d6cb0d06632c7706a16cb3d448e0c3cfce (diff) | |
download | cpython-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.py | 2 |
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: |