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

3 files changed

Lines changed: 1615 additions & 1 deletion

File tree

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)