Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
Add guard for dict return value of links
Browse files Browse the repository at this point in the history
Sometimes the result of a `response.links.get` call is a dictionary,
probably due to a bug in the requests version we use. This patch adds the
necessary checks to compensate for this.
  • Loading branch information
BYK committed Sep 11, 2013
1 parent 4fc5830 commit 1640be8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pyresto/core.py
Expand Up @@ -465,7 +465,13 @@ def _continuator(cls, response):
"""

return response.links.get('next', None)
link = response.links.get('next', None)

# Link is a dict sometimes, probably a Request bug
if link and isinstance(link, dict):
return link.get('url')

return link

#: The class method which receives the class object and the body text of
#: the server response to be parsed. It is expected to return a
Expand Down

0 comments on commit 1640be8

Please sign in to comment.