8000 Correctly get the commit's message by rco-ableton · Pull Request #453 · sigmavirus24/github3.py · GitHub
[go: up one dir, main page]

Skip to content

Correctly get the commit's message #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 23, 2015

Conversation

rco-ableton
Copy link
Contributor

This patch exposes the commit's message from the "internal" commit. Should fix #330.

@@ -350,7 +350,7 @@ def _update_attributes(self, commit):
#: SHA of this commit.
self.sha = commit.get('sha')
#: Commit message
self.message = commit.get('message')
self.message = commit.get('commit').get('message')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in this case, you want to do

commit.get('commit', {}).get('message')

Otherwise if commit isn't there you'll get an AttributeError for NoneType because None doesn't have a .get method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, patch updated!

@sigmavirus24
Copy link
Owner

Thanks @rco-ableton !

sigmavirus24 added a commit that referenced this pull request Oct 23, 2015
Correctly get the commit's message
@sigmavirus24 sigmavirus24 merged commit ccdf55d into sigmavirus24:develop Oct 23, 2015
@rco-ableton
Copy link
Contributor Author

No problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0