Patchwork [1,of,9,pyflakes] memory: avoid shadowing variables inside a list comprehension

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

Comments

Augie Fackler - Nov. 10, 2016, 9:52 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1478813558 18000
#      Thu Nov 10 16:32:38 2016 -0500
# Node ID 9e9aa14582e1fb793aa831d3120d7354f2d62782
# Parent  4a82a34d2694953ad58e5565a318d6909978d4ca
memory: avoid shadowing variables inside a list comprehension

Patch

diff --git a/contrib/memory.py b/contrib/memory.py
--- a/contrib/memory.py
+++ b/contrib/memory.py
@@ -25,8 +25,8 @@  def memusage(ui):
             key = parts[0][2:-1].lower()
             if key in result:
                 result[key] = int(parts[1])
-    ui.write_err(", ".join(["%s: %.1f MiB" % (key, value / 1024.0)
-                            for key, value in result.iteritems()]) + "\n")
+    ui.write_err(", ".join(["%s: %.1f MiB" % (k, v / 1024.0)
+                            for k, v in result.iteritems()]) + "\n")
 
 def extsetup(ui):
     atexit.register(memusage, ui)