Skip to content

Commit 76db50e

Browse files
committed
Thought I had already changed the forks behavior.
Guess I must not have pushed it from my desktop. Also, this should fix the python3 problem with b64decoding a bytes object instead of a string.
1 parent ff28b33 commit 76db50e

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

github3/gist.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def fork(self):
186186
@property
187187
def forks(self):
188188
"""The number of forks of this gist."""
189-
return self._forks
189+
return len(self._forks)
190190

191191
@property
192192
def git_pull_url(self):
@@ -237,6 +237,10 @@ def list_files(self):
237237
stored in this gist."""
238238
return self._files
239239

240+
def list_forks(self):
241+
"""List of :class:`Gist <Gist>`\ s representing forks of this gist."""
242+
return self._forks
243+
240244
def refresh(self):
241245
"""Updates this gist by getting the information from the API again.
242246

github3/git.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def __init__(self, blob):
1818
super(Blob, self).__init__(blob)
1919
self._api = blob.get('url')
2020
self._content = blob.get('content')
21+
if isinstance(self._content, bytes):
22+
self._content = self._content.decode('utf-8')
2123
self._enc = blob.get('encoding')
2224
if self._enc == 'base64':
2325
self._decoded = b64decode(self._content)

0 commit comments

Comments
 (0)