From 908a92897b45baaa99a6fcbad9c84cfc407a908c Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Sun, 12 Jan 2020 07:13:31 -0800 Subject: [PATCH] Remove unnecessary token_info parameter for oauth2.SpotifyClientCredentials methods (#223) --- spotipy/oauth2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index f749974..47c13fa 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -94,14 +94,15 @@ class SpotifyClientCredentials(object): token_info = response.json() return token_info - def is_token_expired(self, token_info): - return is_token_expired(token_info) + def is_token_expired(self): + return is_token_expired(self.token_info) - def _add_custom_values_to_token_info(self, token_info): + def _add_custom_values_to_token_info(self): """ Store some values that aren't directly provided by a Web API response. """ + token_info = self.token_info token_info['expires_at'] = int(time.time()) + token_info['expires_in'] return token_info