diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-03-02 09:02:52 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-03-02 09:02:52 +0300 |
commit | 7093e8b40a732fabf067acaefbb37f2b151519ee (patch) | |
tree | 2afe530f7fe9d98c7f884ff3751fc24832cdefed | |
parent | 8f2c3c63e970a419fbb2684759893ae17cbc2ea7 (diff) |
Cleanup: remove Python 2.x support from complete_calltip
-rw-r--r-- | release/scripts/modules/console/complete_calltip.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/release/scripts/modules/console/complete_calltip.py b/release/scripts/modules/console/complete_calltip.py index 611be00b633..4271003ae13 100644 --- a/release/scripts/modules/console/complete_calltip.py +++ b/release/scripts/modules/console/complete_calltip.py @@ -107,11 +107,7 @@ def get_argspec(func, strip_self=True, doc=None, source=None): try: func = func.__func__ except AttributeError: - try: - # py 2.X - func = func.im_func - except AttributeError: - pass + pass # is callable? if not hasattr(func, '__call__'): return '' @@ -141,14 +137,10 @@ def get_argspec(func, strip_self=True, doc=None, source=None): argspec = inspect.formatargspec(*inspect.getfullargspec(func)) except: try: - # py 2.X - argspec = inspect.formatargspec(*inspect.getargspec(func)) + argspec = inspect.formatargvalues( + *inspect.getargvalues(func)) except: - try: - argspec = inspect.formatargvalues( - *inspect.getargvalues(func)) - except: - argspec = '' + argspec = '' if strip_self: argspec = argspec.replace('self, ', '') return argspec |