Close the connection when done

This commit is contained in:
Joona Hoikkala 2015-06-05 13:49:01 +03:00
parent c944cc772f
commit 660f34b343

View File

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