Python no longer prefers use of has_key method, use "in" instead
authorMats Wichmann <mats@linux.com>
Fri, 10 Mar 2017 20:22:28 +0000 (13:22 -0700)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Thu, 6 Apr 2017 16:32:55 +0000 (16:32 +0000)
Fix sense of one test broken in first version.

Change-Id: I0374d68320fd4591c8f3e8632322682b5c573f39
Signed-off-by: Mats Wichmann <mats@linux.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17839
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
build_common/SConscript
build_common/tools/UnpackAll.py
extlibs/gtest/SConscript
resource/csdk/connectivity/build/SConscript
resource/csdk/stack/samples/tizen/SimpleClientServer/SConscript
service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/SConscript
service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/SConscript

index c57eb84..4e0a3fc 100755 (executable)
@@ -36,7 +36,7 @@ host = platform.system().lower()
 if 'msys_nt' in host:
     host = 'msys_nt'
 
-if not host_target_map.has_key(host):
+if host not in host_target_map:
     print "\nError: Current system (%s) isn't supported\n" % host
     Exit(1)
 
index 85e1689..dd42f2e 100644 (file)
@@ -239,7 +239,7 @@ def __emitter( target, source, env ) :
     # the targets. On physical files we can do this with the LISTCMD, but on
     # non-physical files we hope the user knows the target files, so we inject
     # this knowledge into the return target.
-    if env.has_key("UNPACKLIST") :
+    if "UNPACKLIST" in env:
         if not SCons.Util.is_List(env["UNPACKLIST"]) and not SCons.Util.is_String(env["UNPACKLIST"]) :
             raise SCons.Errors.StopError( "manual target list of [%s] must be a string or list" % (source[0]) )
         if not env["UNPACKLIST"] :
index de39e93..39c0b5f 100644 (file)
@@ -73,7 +73,7 @@ elif target_os in ['darwin', 'msys_nt']:
 elif target_os in ['windows']:
        # Avoid building the same StaticLibrary in more than one environment, by using the
        # IOTIVITY_GTEST_HAS_BEEN_BUILT environment variable
-       if not env.has_key('IOTIVITY_GTEST_HAS_BEEN_BUILT'):
+       if 'IOTIVITY_GTEST_HAS_BEEN_BUILT' not in env:
                gtest_env.AppendUnique(CPPPATH = [ gtest_dir ])
                gtest_build_env = gtest_env.Clone()
                gtest_build_env.AppendUnique(CPPPATH = [ os.path.join(gtest_dir, 'include') ])
index c697fff..a0455d3 100644 (file)
@@ -26,7 +26,7 @@ os_arch_map = {
 
 host = platform.system().lower()
 
-if not host_target_map.has_key(host):
+if host not in host_target_map:
        print "\nError: Current system (%s) isn't supported\n" % host
        Exit(1)
 
index 7d05e4b..49e2e68 100644 (file)
@@ -27,7 +27,7 @@ os_arch_map = {
 
 host = platform.system().lower()
 
-if not host_target_map.has_key(host):
+if host not in host_target_map:
        print "\nError: Current system (%s) isn't supported\n" % host
        Exit(1)
 
index 5315f4f..b478ff6 100644 (file)
@@ -47,7 +47,7 @@ os_arch_map = {
 
 host = platform.system().lower()
 
-if not host_target_map.has_key(host):
+if host not in host_target_map:
     print "\nError: Current system (%s) isn't supported\n" % host
     Exit(1)
 
index b59d4ae..f7fb133 100644 (file)
@@ -30,7 +30,7 @@ es_target_enrollee_map = {
 
 host = platform.system().lower()
 
-if not host_target_map.has_key(host):
+if host not in host_target_map:
        print "\nError: Current system (%s) isn't supported\n" % host
        Exit(1)