summaryrefslogtreecommitdiff
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>2017-09-18 16:59:49 +0200
committerNoam Postavsky <npostavs@gmail.com>2017-09-25 19:39:19 -0400
commita2244f417a7cf577172cec927b055f0aca9ef282 (patch)
tree1cafe6e74c38a4d3ae6ce46572837131ca5f8ec8 /lisp/progmodes/python.el
parent79162cb0db1b62eec35f4fec0e6eac8669bc8f37 (diff)
downloademacs-a2244f417a7cf577172cec927b055f0aca9ef282.tar.gz
Improve python3-compatibility of fallback completion (Bug#28499)
* lisp/progmodes/python.el (python-eldoc-setup-code): Use inspect.getfullargspec instead of inspect.getargspec to avoid a deprecation warning on every usage of eldoc in python-mode. Copyright-paperwork-exempt: yes
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index f3513ced4bb..365191c56b0 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -4271,8 +4271,10 @@ See `python-check-command' for the default."
import inspect
try:
str_type = basestring
+ argspec_function = inspect.getargspec
except NameError:
str_type = str
+ argspec_function = inspect.getfullargspec
if isinstance(obj, str_type):
obj = eval(obj, globals())
doc = inspect.getdoc(obj)
@@ -4285,9 +4287,7 @@ See `python-check-command' for the default."
target = obj
objtype = 'def'
if target:
- args = inspect.formatargspec(
- *inspect.getargspec(target)
- )
+ args = inspect.formatargspec(*argspec_function(target))
name = obj.__name__
doc = '{objtype} {name}{args}'.format(
objtype=objtype, name=name, args=args