From d140d1a4b6f88fa80d488f3ef1956a0313cdeb69 Mon Sep 17 00:00:00 2001 From: dieser-niko Date: Sun, 13 Oct 2024 22:31:28 +0200 Subject: [PATCH] return Scope.make_string(scope) if all values in scope are Scope objects --- spotipy/util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spotipy/util.py b/spotipy/util.py index d0d84ef3..223e13d8 100644 --- a/spotipy/util.py +++ b/spotipy/util.py @@ -1,5 +1,7 @@ from __future__ import annotations +from spotipy import Scope + """ Shows a user's playlists. This needs to be authenticated via OAuth. """ __all__ = ["CLIENT_CREDS_ENV_VARS", "get_host_port", "normalize_scope", "Retry"] @@ -51,6 +53,8 @@ def normalize_scope(scope): scopes = scope.split(',') elif isinstance(scope, Iterable): + if all(isinstance(s, Scope) for s in scope): + return Scope.make_string(scope) scopes = scope else: raise Exception(