Skip to content

Commit 4e1e23d

Browse files
authored
Merge pull request #53 from migueldiascosta/list_comprehensions_single_letter_variables
use even more single-letter variables in list comprehensions to avoid overwriting variables outside of list comprehensions when using Python 2
2 parents 14715cb + 26657cd commit 4e1e23d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

easybuild/framework/easyconfig/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def det_easyconfig_paths(orig_paths):
334334
:return: list of paths to easyconfig files
335335
"""
336336
try:
337-
from_prs = [int(pr_nr) for pr_nr in build_option('from_pr')]
337+
from_prs = [int(x) for x in build_option('from_pr')]
338338
except ValueError:
339339
raise EasyBuildError("Argument to --from-pr must be a comma separated list of PR #s.")
340340

easybuild/tools/options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,7 @@ def set_up_configuration(args=None, logfile=None, testing=False, silent=False):
14641464

14651465
# map list of strings --from-pr value to list of integers
14661466
try:
1467-
from_prs = [int(pr_nr) for pr_nr in eb_go.options.from_pr]
1467+
from_prs = [int(x) for x in eb_go.options.from_pr]
14681468
except ValueError:
14691469
raise EasyBuildError("Argument to --from-pr must be a comma separated list of PR #s.")
14701470

@@ -1500,7 +1500,7 @@ def set_up_configuration(args=None, logfile=None, testing=False, silent=False):
15001500
# done here instead of in _postprocess_include because github integration requires build_options to be initialized
15011501
if eb_go.options.include_easyblocks_from_pr:
15021502
try:
1503-
easyblock_prs = [int(pr_nr) for pr_nr in eb_go.options.include_easyblocks_from_pr]
1503+
easyblock_prs = [int(x) for x in eb_go.options.include_easyblocks_from_pr]
15041504
except ValueError:
15051505
raise EasyBuildError("Argument to --include-easyblocks-from-pr must be a comma separated list of PR #s.")
15061506

easybuild/tools/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def create_test_report(msg, ecs_with_res, init_session_state, pr_nrs=None, gist_
193193
descr = "(partial) EasyBuild log for failed build of %s" % ec['spec']
194194

195195
if pr_nrs is not None:
196-
descr += " (PR #%s)" % ', #'.join(str(pr_nr) for pr_nr in pr_nrs)
196+
descr += " (PR #%s)" % ', #'.join(str(x) for x in pr_nrs)
197197

198198
if easyblock_pr_nrs:
199199
descr += "".join(" (easyblock PR #%s)" % nr for nr in easyblock_pr_nrs)

0 commit comments

Comments
 (0)