Test for major Python version and use inspect.getargspec() or
inspect.getfullargspec() respectively to silence deprecation warnings in
Python 3
This commit is contained in:
Vladimir Zhelezov 2018-12-10 08:40:32 +01:00
parent ca359d7e0d
commit 3e0b2ad146

View file

@ -127,7 +127,10 @@ class BeetsPlugin(object):
value after the function returns). Also determines which params may not
be sent for backwards-compatibility.
"""
argspec = inspect.getargspec(func)
if six.PY2:
argspec = inspect.getargspec(func)
else:
argspec = inspect.getfullargspec(func)
@wraps(func)
def wrapper(*args, **kwargs):