raise TweepError('Failed to parse JSON payload: %s' % e)
needs_cursors = 'cursor' in method.session.params
- if needs_cursors and isinstance(json, dict):
- if 'previous_cursor' in json:
- if 'next_cursor' in json:
- cursors = json['previous_cursor'], json['next_cursor']
- return json, cursors
+ if needs_cursors 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:
return json