Close the connection when done

This commit is contained in:
Joona Hoikkala 2015-06-05 13:49:01 +03:00
parent c944cc772f
commit 660f34b343
1 changed files with 2 additions and 0 deletions

View File

@ -102,6 +102,8 @@ class Spotify(object):
except:
raise SpotifyException(r.status_code,
-1, '%s:\n %s' % (r.url, r.json()['error']['message']))
finally:
r.connection.close()
if len(r.text) > 0:
results = r.json()
if self.trace: # pragma: no cover