From 4f15a6f07ef3abad386eb81db09c539e25011b70 Mon Sep 17 00:00:00 2001 From: josduj Date: Wed, 18 Jan 2017 10:26:14 +0100 Subject: [PATCH] Fixes error when scope is not set --- spotipy/oauth2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index 7574f888..fe9ae0d4 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -149,8 +149,10 @@ def _save_token_info(self, token_info): pass def _is_scope_subset(self, needle_scope, haystack_scope): - needle_scope = set(needle_scope.split()) - haystack_scope = set(haystack_scope.split()) + if needle_scope: + needle_scope = set(needle_scope.split()) + if haystack_scope: + haystack_scope = set(haystack_scope.split()) return needle_scope <= haystack_scope