Commit 8e6f99a5 authored by Joshua Roesslein's avatar Joshua Roesslein
Browse files

Only return cursors if needed.

parent 2dc3670c
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment