From: Joshua Roesslein Date: Tue, 1 Nov 2011 04:05:31 +0000 (-0500) Subject: Only return cursors if needed. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8e6f99a5a2393330f5c1586df67e7df964d9d0a0;p=tweepy.git Only return cursors if needed. --- diff --git a/tweepy/parsers.py b/tweepy/parsers.py index 1aa643e..cf66dac 100644 --- a/tweepy/parsers.py +++ b/tweepy/parsers.py @@ -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: