8000 Use _instance_or_null in github3.gists · helenst/github3.py@7d1de6e · GitHub
[go: up one dir, main page]

Skip to content

Commit 7d1de6e

Browse files
committed
Use _instance_or_null in github3.gists
1 parent 0681dce commit 7d1de6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

github3/gists/gist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def create_comment(self, body):
114114
if body:
115115
url = self._build_url('comments', base_url=self._api)
116116
json = self._json(self._post(url, data={'body': body}), 201)
117-
return GistComment(json, self) if json else None
117+
return self._instance_or_null(GistComment, json)
118118

119119
@requires_auth
120120
def delete(self):
@@ -160,7 +160,7 @@ def fork(self):
160160
"""
161161
url = self._build_url('forks', base_url=self._api)
162162
json = self._json(self._post(url), 201)
163-
return Gist(json, self) if json else None
163+
return self._instance_or_null(Gist, json)
164164

165165
@requires_auth
166166
def is_starred(self):

0 commit comments

Comments
 (0)
0