summaryrefslogtreecommitdiffstats
path: root/Lib/inspect.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-03-06 17:59:45 (GMT)
committerGitHub <noreply@github.com>2018-03-06 17:59:45 (GMT)
commit8a387219bdfb6ee34928d6168ac42ca559f11c9a (patch)
treec56b898cf5b12a681af7ca282e9f4c8ba2a14a43 /Lib/inspect.py
parent5d92647102fac9e116b98ab8bbc632eeed501c34 (diff)
downloadcpython-8a387219bdfb6ee34928d6168ac42ca559f11c9a.zip
cpython-8a387219bdfb6ee34928d6168ac42ca559f11c9a.tar.gz
cpython-8a387219bdfb6ee34928d6168ac42ca559f11c9a.tar.bz2
bpo-33009: Fix inspect.signature() for single-parameter partialmethods. (GH-6004)
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r--Lib/inspect.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py
index 57c0487..512785f 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -2254,7 +2254,8 @@ def _signature_from_callable(obj, *,
return sig
else:
sig_params = tuple(sig.parameters.values())
- assert first_wrapped_param is not sig_params[0]
+ assert (not sig_params or
+ first_wrapped_param is not sig_params[0])
new_params = (first_wrapped_param,) + sig_params
return sig.replace(parameters=new_params)