Skip to content

Commit

Permalink
Do not return bytes, but str (#485)
Browse files Browse the repository at this point in the history
* Do not return bytes, but str

* Fix issue reviewers found. Thanks!

* Alter tests to pass for download_debug_certificate

* Fix too long line

* This makes it easier - thank you lpramuk
  • Loading branch information
jhutar authored and rochacbruno committed Apr 3, 2018
1 parent 4878142 commit 8d0d3f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ def _handle_response(response, server_config, synchronous=False, timeout=None):
return
if 'application/json' in response.headers.get('content-type', '').lower():
return response.json()
elif isinstance(response.content, bytes):
return response.content.decode('utf-8')
else:
return response.content

Expand Down

0 comments on commit 8d0d3f6

Please sign in to comment.