Only return cursors if needed.
authorJoshua Roesslein <jroesslein@gmail.com>
Tue, 1 Nov 2011 04:05:31 +0000 (23:05 -0500)
committerJoshua Roesslein <jroesslein@gmail.com>
Tue, 1 Nov 2011 04:05:31 +0000 (23:05 -0500)
tweepy/parsers.py

index 1aa643e8451503e636bd7a46d08b42810e0f5743..cf66dacc4b64e084fbf445c0e65113f677cd42cd 100644 (file)
@@ -39,7 +39,8 @@ class JSONParser(Parser):
         except Exception, e:
             raise TweepError('Failed to parse JSON payload: %s' % e)
 
-        if isinstance(json, dict) and 'previous_cursor' in json and 'next_cursor' in json:
+        needsCursors = method.parameters.has_key('cursor')
+        if needsCursors and isinstance(json, dict) and 'previous_cursor' in json and 'next_cursor' in json:
             cursors = json['previous_cursor'], json['next_cursor']
             return json, cursors
         else: