Merge pull request #392 from TimJay/master

requests_cache compatibility
This commit is contained in:
Stéphane Bruckert 2020-01-12 01:48:16 +00:00 committed by GitHub
commit b1ceab2b8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,6 +133,7 @@ class Spotify(object):
raise SpotifyException(r.status_code,
-1, '%s:\n %s' % (r.url, 'error'), headers=r.headers)
finally:
if hasattr(r, "connection"):
r.connection.close()
if r.text and len(r.text) > 0 and r.text != 'null':
results = r.json()