From 77b2bd90bc6703740b44306dba4ee2c136e1b283 Mon Sep 17 00:00:00 2001 From: dieser-niko Date: Sun, 13 Oct 2024 22:23:57 +0200 Subject: [PATCH] instead of checking if item is list or tuple, just check if it's iterable --- spotipy/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spotipy/util.py b/spotipy/util.py index 544394a..d0d84ef 100644 --- a/spotipy/util.py +++ b/spotipy/util.py @@ -6,6 +6,7 @@ __all__ = ["CLIENT_CREDS_ENV_VARS", "get_host_port", "normalize_scope", "Retry"] import logging from types import TracebackType +from collections.abc import Iterable import urllib3 @@ -48,7 +49,8 @@ def normalize_scope(scope): if scope: if isinstance(scope, str): scopes = scope.split(',') - elif isinstance(scope, list) or isinstance(scope, tuple): + + elif isinstance(scope, Iterable): scopes = scope else: raise Exception(