Fix API.search() by patching a bug in parsers.
authorJoshua <jroesslein@gmail.com>
Sat, 30 Jan 2010 18:45:38 +0000 (12:45 -0600)
committerJoshua <jroesslein@gmail.com>
Sat, 30 Jan 2010 18:45:38 +0000 (12:45 -0600)
tweepy/parsers.py

index e56cbf155aa5317684fd359ff086dcc1ec373f7e..7b9fc13fb537e5846f78c72ad853e10a5023a6f6 100644 (file)
@@ -30,7 +30,7 @@ class JSONParser(Parser):
         except Exception, e:
             raise TweepError('Failed to parse JSON payload: %s' % e)
 
-        if payload_list and isinstance(json, dict):
+        if isinstance(json, dict) and 'previous_cursor' in json and 'next_cursor' in json:
             cursors = json['previous_cursor'], json['next_cursor']
             return json, cursors
         else: