Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a0c9967

Browse files
committed
Handle issues closed manually when verifying
Sometimes issues are closed by hand, and the user has to verify by hand in that case.
1 parent 85301f9 commit a0c9967

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

milestone-patches.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ def issue_get_closing_sha(issue):
5959
# If the event closing the issue was not a commit, it was closed via PR
6060
# and the immediate next event is most likely the commit that closed it
6161
if not e.commit_id:
62-
e = next(events)
62+
try:
63+
e = next(events)
64+
except StopIteration:
65+
print('Issue {} was closed, but could not find associated PR'.format(issue.number))
66+
return None
6367
if not e.commit_id or not e.commit_url:
6468
print('Issue {} was closed but no commit was associated!?'.format(issue.number))
6569
return None

0 commit comments

Comments
 (0)