Skip to content

Commit 3bbf975

Browse files
committed
avoid appending directly to from_prs, tidy if/else logic
1 parent fa62968 commit 3bbf975

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

easybuild/framework/easyconfig/tools.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,14 @@ def alt_easyconfig_paths(tmpdir, tweaked_ecs=False, from_prs=None, review_pr=Non
321321

322322
# paths where files touched in PRs will be downloaded to,
323323
# which are picked up via 'pr_paths' build option in fetch_files_from_pr
324-
pr_paths = None
325-
if from_prs and review_pr:
326-
from_prs.append(review_pr) if review_pr not in from_prs else from_prs
327-
elif review_pr:
328-
from_prs = [review_pr]
329-
324+
pr_paths = []
330325
if from_prs:
331-
pr_paths = [os.path.join(tmpdir, 'files_pr%s' % pr) for pr in from_prs]
326+
pr_paths = from_prs
327+
if review_pr and review_pr not in pr_paths:
328+
pr_paths.append(review_pr)
329+
330+
if pr_paths:
331+
pr_paths = [os.path.join(tmpdir, 'files_pr%s' % pr) for pr in pr_paths]
332332

333333
return tweaked_ecs_paths, pr_paths
334334

0 commit comments

Comments
 (0)