From: Harmon Date: Thu, 14 Jan 2021 19:24:53 +0000 (-0600) Subject: Treat all 2xx HTTP status codes as successful responses X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a0f69848540fceae68de1be2e4dbd3fc6c7794ec;p=tweepy.git Treat all 2xx HTTP status codes as successful responses --- 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')