Use unwrap before isbuiltin check

`inspect.isbuiltin` does not unwrap obj, but `inspect.signature` does,
which can result in a ValueError.

    >>> wx.Bell
    <built-in function Bell>
    >>> bell #= dcor(wx.Bell)
    <function Bell at 0x0000015E53D92B60>
    >>> inspect.isbuiltin(bell)
    False
    >>> inspect.signature(bell)
    ... (snip) ...
    ValueError: no signature found for builtin <built-in function Bell>
This commit is contained in:
Kazuya O'moto
2023-11-26 16:31:41 +09:00
parent 172e732a0c
commit 1fb1e84012

View File

@@ -171,6 +171,7 @@ def getCallTip(command='', locals=None):
pass
tip1 = ''
argspec = ''
obj = inspect.unwrap(obj)
if inspect.isbuiltin(obj):
# Builtin functions don't have an argspec that we can get.
pass