Skip to content

Commit c09da4c

Browse files
committed
Fix ValueError: invalid literal for int() with base 10: '128274 (abandoned proposal)'
Caused by issue 125997.
1 parent 910c11c commit c09da4c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

potential_closeable_issues.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ def check_issue(api: GhApi, issue: Issue) -> list[Issue]:
6363
linked_prs.append(line.strip())
6464

6565
for pr_line in linked_prs:
66-
pr_number = int(pr_line.split("-")[1])
66+
# pr_line is usually like "* gh-12345" but sometimes extra text is added
67+
# like "* gh-12345 (abandoned proposal)", so extract the gh-12345 part
68+
word = next(word for word in pr_line.split() if word.startswith("gh-"))
69+
pr_number = int(word.split("-")[1])
6770
try:
6871
pr = api.pulls.get(pr_number)
6972
except HTTP404NotFoundError as e:

0 commit comments

Comments
 (0)