From 8e6f99a5a2393330f5c1586df67e7df964d9d0a0 Mon Sep 17 00:00:00 2001 From: Joshua Roesslein Date: Mon, 31 Oct 2011 23:05:31 -0500 Subject: [PATCH] Only return cursors if needed. --- tweepy/parsers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- 2.25.1