diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 6 |
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." | |||
| 4271 | import inspect | 4271 | import inspect |
| 4272 | try: | 4272 | try: |
| 4273 | str_type = basestring | 4273 | str_type = basestring |
| 4274 | argspec_function = inspect.getargspec | ||
| 4274 | except NameError: | 4275 | except NameError: |
| 4275 | str_type = str | 4276 | str_type = str |
| 4277 | argspec_function = inspect.getfullargspec | ||
| 4276 | if isinstance(obj, str_type): | 4278 | if isinstance(obj, str_type): |
| 4277 | obj = eval(obj, globals()) | 4279 | obj = eval(obj, globals()) |
| 4278 | doc = inspect.getdoc(obj) | 4280 | doc = inspect.getdoc(obj) |
| @@ -4285,9 +4287,7 @@ See `python-check-command' for the default." | |||
| 4285 | target = obj | 4287 | target = obj |
| 4286 | objtype = 'def' | 4288 | objtype = 'def' |
| 4287 | if target: | 4289 | if target: |
| 4288 | args = inspect.formatargspec( | 4290 | args = inspect.formatargspec(*argspec_function(target)) |
| 4289 | *inspect.getargspec(target) | ||
| 4290 | ) | ||
| 4291 | name = obj.__name__ | 4291 | name = obj.__name__ |
| 4292 | doc = '{objtype} {name}{args}'.format( | 4292 | doc = '{objtype} {name}{args}'.format( |
| 4293 | objtype=objtype, name=name, args=args | 4293 | objtype=objtype, name=name, args=args |