Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
776070ef
Commit
776070ef
authored
Jul 26, 2016
by
David Laban
Browse files
Fix bug in JSONParser.parse() which causes it to return None
Re-combine tower-of-ifs into a single if/else. Fixes #765
parent
cd46550b
Changes
1
Hide whitespace changes
Inline
Side-by-side
tweepy/parsers.py
View file @
776070ef
...
...
@@ -54,11 +54,11 @@ class JSONParser(Parser):
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment