From a0f69848540fceae68de1be2e4dbd3fc6c7794ec Mon Sep 17 00:00:00 2001 From: Harmon Date: Thu, 14 Jan 2021 13:24:53 -0600 Subject: [PATCH] Treat all 2xx HTTP status codes as successful responses --- tweepy/binder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tweepy/binder.py b/tweepy/binder.py index f44ba92..f978aec 100644 --- a/tweepy/binder.py +++ b/tweepy/binder.py @@ -175,7 +175,7 @@ def bind_api(**config): except Exception as e: raise TweepError(f'Failed to send request: {e}').with_traceback(sys.exc_info()[2]) - if resp.status_code in (200, 204): + if 200 <= resp.status_code < 300: break rem_calls = resp.headers.get('x-rate-limit-remaining') -- 2.25.1