Skip to content

Commit

Permalink
Merge pull request #53 from migueldiascosta/list_comprehensions_singl…
Browse files Browse the repository at this point in the history
…e_letter_variables

use even more single-letter variables in list comprehensions to avoid overwriting variables outside of list comprehensions when using Python 2
  • Loading branch information
boegel authored Jun 8, 2021
2 parents 14715cb + 26657cd commit 4e1e23d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion easybuild/framework/easyconfig/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def det_easyconfig_paths(orig_paths):
:return: list of paths to easyconfig files
"""
try:
from_prs = [int(pr_nr) for pr_nr in build_option('from_pr')]
from_prs = [int(x) for x in build_option('from_pr')]
except ValueError:
raise EasyBuildError("Argument to --from-pr must be a comma separated list of PR #s.")

Expand Down
4 changes: 2 additions & 2 deletions easybuild/tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ def set_up_configuration(args=None, logfile=None, testing=False, silent=False):

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

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

Expand Down
2 changes: 1 addition & 1 deletion easybuild/tools/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def create_test_report(msg, ecs_with_res, init_session_state, pr_nrs=None, gist_
descr = "(partial) EasyBuild log for failed build of %s" % ec['spec']

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

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

0 comments on commit 4e1e23d

Please sign in to comment.