From 3e0b2ad146a437aeb6d6df32cba5ca0f48bbe5b9 Mon Sep 17 00:00:00 2001 From: Vladimir Zhelezov Date: Mon, 10 Dec 2018 08:40:32 +0100 Subject: [PATCH] Fix #2826 Test for major Python version and use inspect.getargspec() or inspect.getfullargspec() respectively to silence deprecation warnings in Python 3 --- beets/plugins.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/beets/plugins.py b/beets/plugins.py index 6dec7ef2a..69784d269 100644 --- a/beets/plugins.py +++ b/beets/plugins.py @@ -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):