[PATCH 4 of 9 pyflakes] hbisect: avoid shadowing a variable in a list comprehension

Augie Fackler raf at durin42.com
Thu Nov 10 16:52:27 EST 2016


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1478813603 18000
#      Thu Nov 10 16:33:23 2016 -0500
# Node ID e1cb78979e91cbe80b0b9445a07cc651604b1baa
# Parent  87382e400db545de30015c477a16e682d8ef36c3
hbisect: avoid shadowing a variable in a list comprehension

diff --git a/mercurial/hbisect.py b/mercurial/hbisect.py
--- a/mercurial/hbisect.py
+++ b/mercurial/hbisect.py
@@ -98,7 +98,7 @@ def bisect(changelog, state):
     tot = len(candidates)
     unskipped = [c for c in candidates if (c not in skip) and (c != badrev)]
     if tot == 1 or not unskipped:
-        return ([changelog.node(rev) for rev in candidates], 0, good)
+        return ([changelog.node(c) for c in candidates], 0, good)
     perfect = tot // 2
 
     # find the best node to test


More information about the Mercurial-devel mailing list