Patchwork [2,of,9,pyflakes] color: avoid shadowing a variable inside a list comprehension

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

Comments

Augie Fackler - Nov. 10, 2016, 9:52 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1478813571 18000
#      Thu Nov 10 16:32:51 2016 -0500
# Node ID 77dce11c461ed9d6668fbbe6ff2ea1149ded4e94
# Parent  9e9aa14582e1fb793aa831d3120d7354f2d62782
color: avoid shadowing a variable inside a list comprehension

Patch

diff --git a/hgext/color.py b/hgext/color.py
--- a/hgext/color.py
+++ b/hgext/color.py
@@ -502,8 +502,8 @@  class colorui(uimod.ui):
                 effects.append(l)
         effects = ' '.join(effects)
         if effects:
-            return '\n'.join([render_effects(s, effects)
-                              for s in msg.split('\n')])
+            return '\n'.join([render_effects(line, effects)
+                              for line in msg.split('\n')])
         return msg
 
 def uisetup(ui):