8000 Don't require a gist to have an owner · netsec/github3.py@c7665a4 · GitHub
[go: up one dir, main page]

Skip to content

Commit c7665a4

Browse files
committed
Don't require a gist to have an owner
As reported in sigmavirus24#883, anonymous gists don't have an owner, so the `Gist` class shouldn't expect one to be there. Closes sigmavirus24#883
1 parent aba7b23 commit c7665a4

File tree

3 files changed

+1615
-1
lines changed

3 files changed

+1615
-1
lines changed

src/github3/gists/gist.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def _update_attributes(self, gist):
4848
self.git_push_url = gist['git_push_url']
4949
self.html_url = gist['html_url']
5050
self.id = gist['id']
51-
self.owner = users.ShortUser(gist['owner'], self)
51+
self.owner = gist.get('owner')
52+
if self.owner is not None:
53+
self.owner = users.ShortUser(self.owner, self)
5254
self.public = gist['public']
5355
self.updated_at = self._strptime(gist['updated_at'])
5456
self.url = self._api = gist['url']

0 commit comments

Comments
 (0)
0