[elbe-devel] [PATCH 05/13] pytlint - pkgdiff: dont iterate over dictionary keys

Manuel Traut manut at linutronix.de
Wed Aug 29 21:07:26 CEST 2018


Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/commands/pkgdiff.py | 8 ++++----
 elbepack/virtapt.py          | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/elbepack/commands/pkgdiff.py b/elbepack/commands/pkgdiff.py
index 59387302..aa769550 100644
--- a/elbepack/commands/pkgdiff.py
+++ b/elbepack/commands/pkgdiff.py
@@ -56,8 +56,8 @@ def run_command(argv):
     gc = apt.Cache()
 
     gen_pkgs = {}
+    # pylint: disable=E1133
     for p in gen_cache.packages:
-        # pylint: disable=E1133
         if opt.noauto:
             if p.current_ver and not \
                gc[p.name].is_auto_installed and not \
@@ -75,8 +75,8 @@ def run_command(argv):
     fc = apt.Cache()
 
     fix_pkgs = {}
+    # pylint: disable=E1133
     for p in fix_cache.packages:
-        # pylint: disable=E1133
         if opt.noauto:
             if p.current_ver and not \
                fc[p.name].is_auto_installed and not \
@@ -90,11 +90,11 @@ def run_command(argv):
         if p not in gen_pkgs:
             print("+<pkg>%s</pkg>" % p)
 
-    for p in gen_pkgs.keys():
+    for p in gen_pkgs:
         if p not in fix_pkgs.keys():
             print("-<pkg>%s</pkg>" % p)
 
-    for p in fix_pkgs.keys():
+    for p in fix_pkgs:
         if p in gen_pkgs.keys() and fix_pkgs[p] != gen_pkgs[p]:
             print(
                 "%s: Version mismatch %s != %s" %
diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index 7bff22c6..62090115 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -249,8 +249,8 @@ class VirtApt(object):
                 pkg = None
                 c = None
             if not c:
+                # pylint: disable=E1133
                 for p in self.cache.packages:
-                    # pylint: disable=E1133
                     for x in p.provides_list:
                         if pp == x[0]:
                             pkg = self.cache[x[2].parent_pkg.name]
-- 
2.18.0




More information about the elbe-devel mailing list