From cf75879a153220d26fa85b1d06568943227870d3 Mon Sep 17 00:00:00 2001 From: Paul Lamere Date: Tue, 28 Apr 2015 06:38:35 -0400 Subject: [PATCH] debugging retry logic --- spotipy/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spotipy/client.py b/spotipy/client.py index d4c12ea..ab3f708 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -123,15 +123,15 @@ class Spotify(object): retries -= 1 status = e.http_status # 429 means we hit a rate limit, backoff - if status == 429 or status >= 500 and status < 600: + if status == 429 or (status >= 500 and status < 600): if retries < 0: raise else: - if self.trace: - print ('retrying ...' + str(delay) + 'secs') + print ('retrying ...' + str(delay) + 'secs') time.sleep(delay) delay += 1 else: + print ('http status:' + status) raise def _post(self, url, args=None, payload=None, **kwargs):