From: Carlos Pita Date: Mon, 4 Oct 2021 09:43:17 +0000 (+0200) Subject: Avoid a warning in python-eldoc-setup-code X-Git-Tag: emacs-29.0.90~3671^2~676 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=60e817e78dfc8eeea3fdd95f7706ebd33fc0c63f;p=emacs.git Avoid a warning in python-eldoc-setup-code * lisp/progmodes/python.el (python-eldoc-setup-code): Avoid a deprecation warning about formatargspec (bug#50996). --- diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index c58ac6f637d..43ee3c0c152 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -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