[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 60e817e: Avoid a warning in python-eldoc-setup-code
From: |
Lars Ingebrigtsen |
Subject: |
master 60e817e: Avoid a warning in python-eldoc-setup-code |
Date: |
Mon, 4 Oct 2021 05:43:53 -0400 (EDT) |
branch: master
commit 60e817e78dfc8eeea3fdd95f7706ebd33fc0c63f
Author: Carlos Pita <carlosjosepita@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Avoid a warning in python-eldoc-setup-code
* lisp/progmodes/python.el (python-eldoc-setup-code): Avoid a
deprecation warning about formatargspec (bug#50996).
---
lisp/progmodes/python.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index c58ac6f..43ee3c0 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 60e817e: Avoid a warning in python-eldoc-setup-code,
Lars Ingebrigtsen <=