From 660f34b343f92bc4bcbe3fdb0dcd0f8c43677cb2 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Fri, 5 Jun 2015 13:49:01 +0300 Subject: [PATCH] Close the connection when done --- spotipy/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spotipy/client.py b/spotipy/client.py index 868c83b..c926814 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -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