Patchwork [12/15] image/kernel-module-split/eglibc-ld.inc: Remove has_key() usage

login
register
mail settings
Submitter Richard Purdie
Date May 7, 2013, 12:56 p.m.
Message ID <1367931368-21504-12-git-send-email-richard.purdie@linuxfoundation.org>
Download mbox | patch
Permalink /patch/49463/
State New
Headers show

Comments

Richard Purdie - May 7, 2013, 12:56 p.m.
The has_key() attribute has been removed in python 3 since there is better
syntax available. Use the improved syntax.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/image.bbclass               |    2 +-
 meta/classes/kernel-module-split.bbclass |    2 +-
 meta/recipes-core/eglibc/eglibc-ld.inc   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 979921f..251bc9a 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -368,7 +368,7 @@  for dir in dirs.split():
       key=str(os.path.join("/",os.path.relpath(item,dir)))
 
       valid=True;
-      if files.has_key(key):
+      if key in files:
         #check whether the file is allow to replace
         if allow_rep.match(key):
           valid=True
diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass
index 45639c6..23714d5 100644
--- a/meta/classes/kernel-module-split.bbclass
+++ b/meta/classes/kernel-module-split.bbclass
@@ -109,7 +109,7 @@  python split_kernel_module_packages () {
         # instead is prefixed with /lib/modules/${KERNEL_VERSION}
         file = file.replace("/lib/modules/%s/" % d.getVar('KERNEL_VERSION', True) or '', '', 1)
 
-        if module_deps.has_key(file):
+        if file in module_deps:
             dependencies = []
             for i in module_deps[file]:
                 m = re.match(pattern, os.path.basename(i))
diff --git a/meta/recipes-core/eglibc/eglibc-ld.inc b/meta/recipes-core/eglibc/eglibc-ld.inc
index e596b55..b1701f00 100644
--- a/meta/recipes-core/eglibc/eglibc-ld.inc
+++ b/meta/recipes-core/eglibc/eglibc-ld.inc
@@ -1,7 +1,7 @@ 
 def ld_append_if_tune_exists(d, infos, dict):
     tune = d.getVar("DEFAULTTUNE", True) or ""
     libdir = d.getVar("base_libdir", True) or ""
-    if dict.has_key(tune):
+    if tune in dict:
         infos['ldconfig'].add('{"' + libdir + '/' + dict[tune][0] + '",' + dict[tune][1] + ' }')
         infos['lddrewrite'].add(libdir+'/'+dict[tune][0])