Skip to content

Commit 14715cb

Browse files
committed
use more single-letter variables in list comprehensions to avoid overwriting variables outside of list comprehension when using Python 2
1 parent ee878ca commit 14715cb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

easybuild/tools/github.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ def reasons_for_closing(pr_data):
12321232

12331233
robot_paths = build_option('robot_path')
12341234

1235-
pr_files = [path for path in fetch_easyconfigs_from_pr(pr_data['number']) if path.endswith('.eb')]
1235+
pr_files = [p for p in fetch_easyconfigs_from_pr(pr_data['number']) if p.endswith('.eb')]
12361236

12371237
obsoleted = []
12381238
uses_archived_tc = []
@@ -1491,17 +1491,17 @@ def add_pr_labels(pr, branch=GITHUB_DEVELOP_BRANCH):
14911491

14921492
download_repo_path = download_repo(branch=branch, path=tmpdir)
14931493

1494-
pr_files = [path for path in fetch_easyconfigs_from_pr(pr) if path.endswith('.eb')]
1494+
pr_files = [p for p in fetch_easyconfigs_from_pr(pr) if p.endswith('.eb')]
14951495

14961496
file_info = det_file_info(pr_files, download_repo_path)
14971497

14981498
pr_target_account = build_option('pr_target_account')
14991499
github_user = build_option('github_user')
15001500
pr_data, _ = fetch_pr_data(pr, pr_target_account, pr_target_repo, github_user)
1501-
pr_labels = [label['name'] for label in pr_data['labels']]
1501+
pr_labels = [x['name'] for x in pr_data['labels']]
15021502

15031503
expected_labels = det_pr_labels(file_info, pr_target_repo)
1504-
missing_labels = [label for label in expected_labels if label not in pr_labels]
1504+
missing_labels = [x for x in expected_labels if x not in pr_labels]
15051505

15061506
dry_run = build_option('dry_run') or build_option('extended_dry_run')
15071507

easybuild/tools/testing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def create_test_report(msg, ecs_with_res, init_session_state, pr_nrs=None, gist_
151151
test_report = []
152152
if pr_nrs is not None:
153153
repo = pr_target_repo or GITHUB_EASYCONFIGS_REPO
154-
pr_urls = ["https://github.com/%s/%s/pull/%s" % (pr_target_account, repo, pr_nr) for pr_nr in pr_nrs]
154+
pr_urls = ["https://github.com/%s/%s/pull/%s" % (pr_target_account, repo, x) for x in pr_nrs]
155155
test_report.extend([
156156
"Test report for %s" % ', '.join(pr_urls),
157157
"",
@@ -333,12 +333,12 @@ def overall_test_report(ecs_with_res, orig_cnt, success, msg, init_session_state
333333
dump_path = build_option('dump_test_report')
334334

335335
try:
336-
pr_nrs = [int(pr_nr) for pr_nr in build_option('from_pr')]
336+
pr_nrs = [int(x) for x in build_option('from_pr')]
337337
except ValueError:
338338
raise EasyBuildError("Argument to --from-pr must be a comma separated list of PR #s.")
339339

340340
try:
341-
easyblock_pr_nrs = [int(pr_nr) for pr_nr in build_option('include_easyblocks_from_pr')]
341+
easyblock_pr_nrs = [int(x) for x in build_option('include_easyblocks_from_pr')]
342342
except ValueError:
343343
raise EasyBuildError("Argument to --include-easyblocks-from-pr must be a comma separated list of PR #s.")
344344

0 commit comments

Comments
 (0)