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.
This commit is contained in:
Marlon (Esolitos) Saglia 2020-05-25 15:32:18 +02:00 committed by GitHub
parent 2e2c7259a9
commit 5c981a1d62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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