Skip to content

Commit

Permalink
handle GitHub issues without a milestone
Browse files Browse the repository at this point in the history
The previous version only handled GitHub issues
 - either with a milestone having a deadline (try clause)
 - or with a milestione without a deadline (except KeyError clause)

This commit handles the case when there's no milestone set at all, and a
TypeError is raised upon subscripting the invalid issue['milestone']
with the value 'due_on'.
  • Loading branch information
dnet committed Jan 1, 2013
1 parent 43f5340 commit 528aeca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion github_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def issue2entry(issue):
url = issue['html_url']
try:
due = issue['milestone']['due_on']
except KeyError:
except (KeyError, TypeError):
due = issue['created_at']
return {
'subtitle': HTML_RE.search(url).group(1),
Expand Down

0 comments on commit 528aeca

Please sign in to comment.