From cf8c79ca353041a5707fdc2050fd00404d57cbe9 Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Fri, 20 Nov 2020 11:20:45 +0100 Subject: [PATCH] Fix unused sorted value in update-release-branch 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. --- .github/update-release-branch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/update-release-branch.py b/.github/update-release-branch.py index ca14893a6..a8ddaae48 100644 --- a/.github/update-release-branch.py +++ b/.github/update-release-branch.py @@ -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