Treat all 2xx HTTP status codes as successful responses
authorHarmon <Harmon758@gmail.com>
Thu, 14 Jan 2021 19:24:53 +0000 (13:24 -0600)
committerHarmon <Harmon758@gmail.com>
Thu, 14 Jan 2021 19:24:53 +0000 (13:24 -0600)
tweepy/binder.py

index f44ba92455f840db6562d392f345760ffc51dba1..f978aec05751db18b29157fcd4882ca5d88b805a 100644 (file)
@@ -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')