Skip to content

Commit

Permalink
Fix unused sorted value in update-release-branch
Browse files Browse the repository at this point in the history
Fix a minor issue in the update-release-branch.py script that performs a
call to `sorted` but doesn't use the output. Since `sorted` does not
operate in place, the call is currently useless. As a result, the function
`get_pr_for_commit` does not currently work as exected. I.e. it is
expected to return the "first" (i.e. lowest PR number), but actually it
returns the first in the list provided by GitHub.
  • Loading branch information
Eric Cornelissen committed Nov 20, 2020
1 parent 4e8634c commit cf8c79c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/update-release-branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def get_pr_for_commit(repo, commit):
if prs.totalCount > 0:
# In the case that there are multiple PRs, return the earliest one
prs = list(prs)
sorted(prs, key=lambda pr: int(pr.number))
return prs[0]
sorted_prs = sorted(prs, key=lambda pr: int(pr.number))
return sorted_prs[0]
else:
return None

Expand Down

0 comments on commit cf8c79c

Please sign in to comment.