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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy