Patchwork [7,of,9,pyflakes] revset: avoid shadowing a variable with a list comprehension

login
register
mail settings
Submitter Augie Fackler
Date Nov. 10, 2016, 9:52 p.m.
Message ID <dace366e1d4818d03d65.1478814750@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/17459/
State Accepted
Headers show

Comments

Augie Fackler - Nov. 10, 2016, 9:52 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1478813710 18000
#      Thu Nov 10 16:35:10 2016 -0500
# Node ID dace366e1d4818d03d65dce96e749acbcd4aadf4
# Parent  24b97734ad1dc450a320c863a2f8023b7fd1cb75
revset: avoid shadowing a variable with a list comprehension

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -437,10 +437,10 @@  def keyvaluepair(repo, subset, k, v):
 def func(repo, subset, a, b, order):
     f = getsymbol(a)
     if f in symbols:
-        fn = symbols[f]
-        if getattr(fn, '_takeorder', False):
-            return fn(repo, subset, b, order)
-        return fn(repo, subset, b)
+        func = symbols[f]
+        if getattr(func, '_takeorder', False):
+            return func(repo, subset, b, order)
+        return func(repo, subset, b)
 
     keep = lambda fn: getattr(fn, '__doc__', None) is not None