Mercurial > kallithea
changeset 6863:bfd7fc9a814e
py3: replace list comprehension with for-loop due to scope
The scope of the list comprehension variable 'x' will be limited to the list
comprehension in python3. Thus switching to a full loop (without this
scope restriction) in preparation for python3.
author | Lars Kruse <devel@sumpfralle.de> |
---|---|
date | Fri, 25 Aug 2017 14:32:31 +0200 |
parents | 9841eef3f2e4 |
children | 7691290837d2 |
files | kallithea/controllers/pullrequests.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/controllers/pullrequests.py Fri Aug 25 14:31:48 2017 +0200 +++ b/kallithea/controllers/pullrequests.py Fri Aug 25 14:32:31 2017 +0200 @@ -484,8 +484,9 @@ org_scm_instance = c.cs_repo.scm_instance # property with expensive cache invalidation check!!! try: - c.cs_ranges = [org_scm_instance.get_changeset(x) - for x in c.pull_request.revisions] + c.cs_ranges = [] + for x in c.pull_request.revisions: + c.cs_ranges.append(org_scm_instance.get_changeset(x)) except ChangesetDoesNotExistError: c.cs_ranges = [] h.flash(_('Revision %s not found in %s') % (x, c.cs_repo.repo_name),