From dab5e08b7a3482464a4b9fe838281565966aa66f Mon Sep 17 00:00:00 2001 From: Richard Mitic Date: Sat, 1 Apr 2017 09:52:36 +0200 Subject: [PATCH] Token cache handles null scopes correctly --- spotipy/oauth2.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index b339918..24d86a1 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -153,11 +153,8 @@ class SpotifyOAuth(object): pass def _is_scope_subset(self, needle_scope, haystack_scope): - if needle_scope: - needle_scope = set(needle_scope.split()) - if haystack_scope: - haystack_scope = set(haystack_scope.split()) - + needle_scope = set(needle_scope.split()) if needle_scope else set() + haystack_scope = set(haystack_scope.split()) if haystack_scope else set() return needle_scope <= haystack_scope def is_token_expired(self, token_info):