Commit 06c06c63 authored by Aaron Hill's avatar Aaron Hill Committed by GitHub
Browse files

Merge pull request #766 from alsuren/fix-765

Fix bug in JSONParser.parse() which causes it to return None
parents a1e4d8b6 776070ef
...@@ -54,11 +54,11 @@ class JSONParser(Parser): ...@@ -54,11 +54,11 @@ class JSONParser(Parser):
raise TweepError('Failed to parse JSON payload: %s' % e) raise TweepError('Failed to parse JSON payload: %s' % e)
needs_cursors = 'cursor' in method.session.params needs_cursors = 'cursor' in method.session.params
if needs_cursors and isinstance(json, dict): if needs_cursors and isinstance(json, dict) \
if 'previous_cursor' in json: and 'previous_cursor' in json \
if 'next_cursor' in json: and 'next_cursor' in json:
cursors = json['previous_cursor'], json['next_cursor'] cursors = json['previous_cursor'], json['next_cursor']
return json, cursors return json, cursors
else: else:
return json return json
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