Skip to content

Commit

Permalink
Merge pull request #179 from richardmitic/token-scope-check
Browse files Browse the repository at this point in the history
Token cache handles null scopes correctly
  • Loading branch information
plamere authored Sep 17, 2017
2 parents cd6475f + dab5e08 commit 133f66c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions spotipy/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,8 @@ def _save_token_info(self, token_info):
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):
Expand Down

0 comments on commit 133f66c

Please sign in to comment.