Skip to content

Commit

Permalink
Decode unicode when printing to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
Mackey22 committed Aug 16, 2017
1 parent d698c9c commit 44ec2fb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hca/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,19 @@
import requests
import sys

import six


def main():
"""Entrance to functionality."""
from .cli import CLI
cli = CLI()
response = cli.make_request(sys.argv[1:])

if isinstance(response, requests.Response):
print(response.content.decode())
elif six.PY2 and type(response) == unicode:
print(response.decode())
elif type(response) == str:
print(response)
else:
Expand Down

0 comments on commit 44ec2fb

Please sign in to comment.