Avoid a warning in python-eldoc-setup-code
* lisp/progmodes/python.el (python-eldoc-setup-code): Avoid a deprecation warning about formatargspec (bug#50996).
This commit is contained in:
parent
1428962590
commit
60e817e78d
1 changed files with 4 additions and 1 deletions
|
@ -4671,7 +4671,10 @@ See `python-check-command' for the default."
|
|||
target = obj
|
||||
objtype = 'def'
|
||||
if target:
|
||||
args = inspect.formatargspec(*argspec_function(target))
|
||||
if hasattr(inspect, 'signature'):
|
||||
args = str(inspect.signature(target))
|
||||
else:
|
||||
args = inspect.formatargspec(*argspec_function(target))
|
||||
name = obj.__name__
|
||||
doc = '{objtype} {name}{args}'.format(
|
||||
objtype=objtype, name=name, args=args
|
||||
|
|
Loading…
Add table
Reference in a new issue