diff options
| author | Carlos Pita | 2021-10-04 11:43:17 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-10-04 11:43:17 +0200 |
| commit | 60e817e78dfc8eeea3fdd95f7706ebd33fc0c63f (patch) | |
| tree | 09a49ff2eb51ea2be49e3d029cf9a2b4aac33e45 /lisp/progmodes/python.el | |
| parent | 1428962590e216163f079ff838f39667383aec56 (diff) | |
| download | emacs-60e817e78dfc8eeea3fdd95f7706ebd33fc0c63f.tar.gz emacs-60e817e78dfc8eeea3fdd95f7706ebd33fc0c63f.zip | |
Avoid a warning in python-eldoc-setup-code
* lisp/progmodes/python.el (python-eldoc-setup-code): Avoid a
deprecation warning about formatargspec (bug#50996).
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 5 |
1 files changed, 4 insertions, 1 deletions
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." | |||
| 4671 | target = obj | 4671 | target = obj |
| 4672 | objtype = 'def' | 4672 | objtype = 'def' |
| 4673 | if target: | 4673 | if target: |
| 4674 | args = inspect.formatargspec(*argspec_function(target)) | 4674 | if hasattr(inspect, 'signature'): |
| 4675 | args = str(inspect.signature(target)) | ||
| 4676 | else: | ||
| 4677 | args = inspect.formatargspec(*argspec_function(target)) | ||
| 4675 | name = obj.__name__ | 4678 | name = obj.__name__ |
| 4676 | doc = '{objtype} {name}{args}'.format( | 4679 | doc = '{objtype} {name}{args}'.format( |
| 4677 | objtype=objtype, name=name, args=args | 4680 | objtype=objtype, name=name, args=args |