mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
bpo-43118: Fix bug in inspect.signature around 'base.__text_signature__' (GH-30285) (#30765)
(cherry picked from commit 881a763cfe
)
Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>
Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>
This commit is contained in:
parent
923c994400
commit
83aef4d340
4 changed files with 27 additions and 2 deletions
|
@ -2511,9 +2511,9 @@ def _signature_from_callable(obj, *,
|
|||
pass
|
||||
else:
|
||||
if text_sig:
|
||||
# If 'obj' class has a __text_signature__ attribute:
|
||||
# If 'base' class has a __text_signature__ attribute:
|
||||
# return a signature based on it
|
||||
return _signature_fromstr(sigcls, obj, text_sig)
|
||||
return _signature_fromstr(sigcls, base, text_sig)
|
||||
|
||||
# No '__text_signature__' was found for the 'obj' class.
|
||||
# Last option is to check if its '__init__' is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue