Skip to content

Commit 72e569c

Browse files
committed
Update GitHub#zen to return unicode
1 parent dac4efa commit 72e569c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

github3/github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,11 +1566,11 @@ def user_with_id(self, number):
15661566
def zen(self):
15671567
"""Returns a quote from the Zen of GitHub. Yet another API Easter Egg
15681568
1569-
:returns: str
1569+
:returns: str (on Python 3, unicode on Python 2)
15701570
"""
15711571
url = self._build_url('zen')
15721572
resp = self._get(url)
1573-
return resp.content if resp.status_code == 200 else ''
1573+
return resp.text if resp.status_code == 200 else b''.decode('utf-8')
15741574

15751575

15761576
class GitHubEnterprise(GitHub):

0 commit comments

Comments
 (0)