Make error code check use a range of values in binder.py
authorAaron Hill <aa1ronham@gmail.com>
Tue, 11 Jun 2013 19:40:52 +0000 (15:40 -0400)
committerAaron Hill <aa1ronham@gmail.com>
Tue, 11 Jun 2013 19:40:52 +0000 (15:40 -0400)
tweepy/binder.py

index f0b0803b4b43ca6c84f3d94381ccb2785d206ec4..6295b4837d877d655c734c85fabe2ae117cc65f7 100644 (file)
@@ -165,7 +165,7 @@ def bind_api(**config):
 
             # If an error was returned, throw an exception
             self.api.last_response = resp
-            if resp.status not in [200, 201, 202]:
+            if resp.status and not 200 <= resp.status < 300:
                 try:
                     error_msg = self.api.parser.parse_error(resp.read())
                 except Exception: