8000 Simplify. · doismellburning/github3.py@95c0096 · GitHub
[go: up one dir, main page]

Skip to content

Commit 95c0096

Browse files
committed
Simplify.
1 parent c68c66d commit 95c0096

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

github3/git.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,14 @@ def __init__(self, commit, session=None):
6060

6161
#: dict containing at least the name, email and date the commit was
6262
# created
63-
self.author = commit.get('author', {})
64-
if self.author is None:
65-
self.author = {}
63+
self.author = commit.get('author', {}) or {}
64+
# If GH returns nil/None then make sure author is a dict
6665
self._author_name = self.author.get('name', '')
6766

6867
#: dict containing similar information to the author attribute
69-
self.committer = commit.get('committer', {})
70-
if self.committer is None:
71-
# blank the data if GH returns no data
72-
self.committer = {}
68+
self.committer = commit.get('committer', {}) or {}
69+
# blank the data if GH returns no data
70+
7371
self._commit_name = self.committer.get('name', '')
7472

7573
#: :class:`Tree <Tree>` the commit belongs to.

0 commit comments

Comments
 (0)
0