8000 Applied @sigmavirus24's suggestions · pythonthings/github3.py@e59bb56 · GitHub
[go: up one dir, main page]

Skip to content

Commit e59bb56

Browse files
Applied @sigmavirus24's suggestions
Replace strring with string in docstring. Simplified main method. Removed condition for checking resp
1 parent 04c549c commit e59bb56

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

github3/repos/branch.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def latest_sha(self, differs_from=''):
4444
See: https://git.io/vaqIw
4545
4646
:param differs_from string: (optional), sha to compare against
47-
:returns: strring of the SHA or None
47+
:returns: string of the SHA or None
4848
"""
4949
# If-None-Match returns 200 instead of 304 value does not have quotes
5050
headers = {
@@ -54,9 +54,9 @@ def latest_sha(self, differs_from=''):
5454
base = self._api.split('/branches', 1)[0]
5555
url = self._build_url('commits', self.name, base_url=base)
5656
resp = self._get(url, headers=headers)
57-
if resp:
58-
sha = None if self._boolean(resp, 304, 200) else resp.content
59-
return sha
57+
if self._boolean(resp, 200, 304):
58+
return resp.content
59+
return None
6060

6161
def protect(self, enforcement=None, status_checks=None):
6262
"""Enable force push protection and configure status check enforcement.

0 commit comments

Comments
 (0)
0