Skip to content

Commit

Permalink
return Scope.make_string(scope) if all values in scope are Scope objects
Browse files Browse the repository at this point in the history
  • Loading branch information
dieser-niko committed Oct 13, 2024
1 parent 77b2bd9 commit d140d1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spotipy/util.py
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit d140d1a

Please sign in to comment.