mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-10-12 01:10:45 +00:00
instead of checking if item is list or tuple, just check if it's iterable
This commit is contained in:
1 parent
ef69d4dde4
commit
77b2bd90bc
1 file changed
+3
-1
+3
-1
@@ -6,6 +6,7 @@ __all__ = ["CLIENT_CREDS_ENV_VARS", "get_host_port", "normalize_scope", "Retry"]
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from types import TracebackType
|
from types import TracebackType
|
||||||
|
from collections.abc import Iterable
|
||||||
|
|
||||||
import urllib3
|
import urllib3
|
||||||
|
|
||||||
@@ -48,7 +49,8 @@ def normalize_scope(scope):
|
|||||||
if scope:
|
if scope:
|
||||||
if isinstance(scope, str):
|
if isinstance(scope, str):
|
||||||
scopes = scope.split(',')
|
scopes = scope.split(',')
|
||||||
elif isinstance(scope, list) or isinstance(scope, tuple):
|
|
||||||
|
elif isinstance(scope, Iterable):
|
||||||
scopes = scope
|
scopes = scope
|
||||||
else:
|
else:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
|
|||||||
Reference in new issue
Block a user