Skip to content

Commit

Permalink
Dont try to parse content if it is None, as throws an unnecessary exc…
Browse files Browse the repository at this point in the history
…eption (this can happend for a lot of reasons, in my case it was an SSL fail)
  • Loading branch information
cyberw committed Nov 13, 2019
1 parent 4c23247 commit 013d64a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion locust/contrib/fasthttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ def text(self):
# A TypeError can be raised if encoding is None
#
# Fallback to decode without specifying encoding
content = unicode(self.content, errors='replace')
if self.content is None:
content = None
else:
content = unicode(self.content, errors='replace')
return content

@property
Expand Down

0 comments on commit 013d64a

Please sign in to comment.