Patchwork [5,of,9,pyflakes] minirst: avoid shadowing a variable in a list comprehension

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

Comments

Augie Fackler - Nov. 10, 2016, 9:52 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1478813621 18000
#      Thu Nov 10 16:33:41 2016 -0500
# Node ID 1c86e7eac26b1bf16ad9c66f4214bb761a28ab1e
# Parent  e1cb78979e91cbe80b0b9445a07cc651604b1baa
minirst: avoid shadowing a variable in a list comprehension

Patch

diff --git a/mercurial/minirst.py b/mercurial/minirst.py
--- a/mercurial/minirst.py
+++ b/mercurial/minirst.py
@@ -697,7 +697,7 @@  def format(text, width=80, indent=0, kee
         if collapse:
             synthetic.reverse()
             for s in synthetic:
-                path = [blocks[i]['lines'][0] for i in s]
+                path = [blocks[syn]['lines'][0] for syn in s]
                 real = s[-1] + 2
                 realline = blocks[real]['lines']
                 realline[0] = ('"%s"' %