Skip to content

Commit 4dcfee6

Browse files
committed
Update doc-strings and replace use of None
1 parent 7c4f8d9 commit 4dcfee6

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

github3/repos/commit.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,21 @@ def _repr(self):
6565
return '<Repository Commit [{0}]>'.format(self.sha[:7])
6666

6767
def diff(self):
68-
"""Return the diff"""
68+
"""Retrieve the diff for this commit.
69+
70+
:returns: the diff as a bytes object
71+
:rtype: bytes
72+
"""
6973
resp = self._get(self._api,
7074
headers={'Accept': 'application/vnd.github.diff'})
71-
return resp.content if self._boolean(resp, 200, 404) else None
75+
return resp.content if self._boolean(resp, 200, 404) else b''
7276

7377
def patch(self):
74-
"""Return the patch"""
78+
"""Retrieve the patch formatted diff for this commit.
79+
80+
:returns: the patch as a bytes object
81+
:rtype: bytes
82+
"""
7583
resp = self._get(self._api,
7684
headers={'Accept': 'application/vnd.github.patch'})
77-
return resp.content if self._boolean(resp, 200, 404) else None
85+
return resp.content if self._boolean(resp, 200, 404) else b''

0 commit comments

Comments
 (0)