mirror of
https://github.com/c0de-archive/spotipy.git
synced 2024-11-04 23:17: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
|
||||
'''
|
||||
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
|
||||
if isinstance(public, bool):
|
||||
data['public'] = public
|
||||
|
Loading…
Reference in New Issue
Block a user