Skip to content

Commit

Permalink
catch TypeError and retry when parsing response; fixes rhgrant10#16 and
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Dec 12, 2021
1 parent 1b000a4 commit f8803ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion berserk/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def parse(self, response):
:return: response data
:rtype: JSON
"""
return response.json(cls=self.decoder)
try:
return response.json(cls=self.decoder)
except TypeError:
return response.json()

def parse_stream(self, response):
"""Yield the parsed data from a stream response.
Expand Down

0 comments on commit f8803ff

Please sign in to comment.