From 5c981a1d62ba6bacd27cb708e75af2fcf1c288e7 Mon Sep 17 00:00:00 2001 From: "Marlon (Esolitos) Saglia" Date: Mon, 25 May 2020 15:32:18 +0200 Subject: [PATCH] In '__init__' super method should use static class name (#497) Currently it is not possible to extend SpotifyClientCredentials and SpotifyOAuth This is because in the class __init__ they refer to 'self.__class__', this leads to an infinite recursion if the parent class doesn't override completely the __init__ method. --- spotipy/oauth2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index 01c8382..b5ec15f 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -112,7 +112,7 @@ class SpotifyClientCredentials(SpotifyAuthBase): environment variables """ - super(self.__class__, self).__init__(requests_session) + super(SpotifyClientCredentials, self).__init__(requests_session) self.client_id = client_id self.client_secret = client_secret @@ -218,7 +218,7 @@ class SpotifyOAuth(SpotifyAuthBase): - username - username of current client """ - super(self.__class__, self).__init__(requests_session) + super(SpotifyOAuth, self).__init__(requests_session) self.client_id = client_id self.client_secret = client_secret