Changeset - bfd7fc9a814e
[Not reviewed]
default
0 1 0
Lars Kruse - 8 years ago 2017-08-25 14:32:31
devel@sumpfralle.de
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.
1 file changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -484,8 +484,9 @@ class PullrequestsController(BaseRepoCon
 

	
 
        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),
0 comments (0 inline, 0 general)