[Yum-devel] [PATCH] fix pylint warnings (unneeded lambda)

Tim Lauridsen tim.lauridsen at googlemail.com
Wed Oct 14 09:44:21 UTC 2009


************* Module yum
W0108:3927:YumBase._limit_installonly_pkgs.<lambda>: Lambda may not be necessary
************* Module yum.depsolve
W0108:594:Depsolve._requiringFromTransaction.<lambda>: Lambda may not be necessary
************* Module yum.pgpmsg
W0108:571:signature.deserialize_subpacket.<lambda>: Lambda may not be necessary
---
 yum/__init__.py |    2 +-
 yum/depsolve.py |    2 +-
 yum/pgpmsg.py   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/yum/__init__.py b/yum/__init__.py
index f73cc3e..aa8228e 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3924,7 +3924,7 @@ class YumBase(depsolve.Depsolve):
                             toremove.append(po)
                             numleft -= 1
                         
-        map(lambda x: self.tsInfo.addErase(x), toremove)
+        map(self.tsInfo.addErase, toremove)
 
     def processTransaction(self, callback=None,rpmTestDisplay=None, rpmDisplay=None):
         '''
diff --git a/yum/depsolve.py b/yum/depsolve.py
index 7ee7cac..40be000 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -590,7 +590,7 @@ class Depsolve(object):
             # before, they're not going to be installed anymore, so we
             # should mark them to be re-checked
             if upgraded.has_key(best.pkgtup):
-                map(lambda x: self.tsInfo.remove(x), upgraded[best.pkgtup])
+                map(self.tsInfo.remove, upgraded[best.pkgtup])
 
         checkdeps = 1
         
diff --git a/yum/pgpmsg.py b/yum/pgpmsg.py
index 2d9e7d9..4f0ff7e 100644
--- a/yum/pgpmsg.py
+++ b/yum/pgpmsg.py
@@ -568,7 +568,7 @@ class signature(pgp_packet) :
             idx = idx + sublen - 1
             return (subtype, expr), idx
         if subtype == SIG_SUB_TYPE_PREF_SYMM_ALGO or subtype == SIG_SUB_TYPE_PREF_HASH_ALGO or subtype == SIG_SUB_TYPE_PREF_COMP_ALGO or subtype == SIG_SUB_TYPE_KEY_FLAGS :
-            algo_list = map(lambda x : ord(x), list(msg[idx:idx+sublen-1]))
+            algo_list = map(ord, list(msg[idx:idx+sublen-1]))
             idx = idx + sublen - 1
             return (subtype, algo_list), idx
         if subtype == SIG_SUB_TYPE_REVOKE_KEY : # revocation key
-- 
1.6.2.5



More information about the Yum-devel mailing list