mirror of
https://github.com/c0de-archive/spotipy.git
synced 2025-01-08 15:42:48 +00:00
Update client.py
Added a check if basestring class exists (Python2 case). If doesn't exist, alias `basestring` to `str` (Python3 case).
This commit is contained in:
parent
463d6c0878
commit
e2b03937e7
@ -418,7 +418,12 @@ class Spotify(object):
|
|||||||
- collaborative - optional is the playlist collaborative
|
- collaborative - optional is the playlist collaborative
|
||||||
'''
|
'''
|
||||||
data = {}
|
data = {}
|
||||||
if isinstance(name, str):
|
# Add Python2 and Python3 compatibility checking string types
|
||||||
|
try:
|
||||||
|
basestring
|
||||||
|
except NameError:
|
||||||
|
basestring = str
|
||||||
|
if isinstance(name, basestring):
|
||||||
data['name'] = name
|
data['name'] = name
|
||||||
if isinstance(public, bool):
|
if isinstance(public, bool):
|
||||||
data['public'] = public
|
data['public'] = public
|
||||||
|
Loading…
Reference in New Issue
Block a user