From 2ffa80b538d6bd87b0374a797f151261f603e8fd Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 10 Mar 2017 13:22:28 -0700 Subject: [PATCH] Python no longer prefers use of has_key method, use "in" instead Fix sense of one test broken in first version. Change-Id: I0374d68320fd4591c8f3e8632322682b5c573f39 Signed-off-by: Mats Wichmann Reviewed-on: https://gerrit.iotivity.org/gerrit/17839 Tested-by: jenkins-iotivity Reviewed-by: Dan Mihai --- build_common/SConscript | 2 +- build_common/tools/UnpackAll.py | 2 +- extlibs/gtest/SConscript | 2 +- resource/csdk/connectivity/build/SConscript | 2 +- resource/csdk/stack/samples/tizen/SimpleClientServer/SConscript | 2 +- .../easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/SConscript | 2 +- .../sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/SConscript | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build_common/SConscript b/build_common/SConscript index c57eb84..4e0a3fc 100755 --- a/build_common/SConscript +++ b/build_common/SConscript @@ -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) diff --git a/build_common/tools/UnpackAll.py b/build_common/tools/UnpackAll.py index 85e1689..dd42f2e 100644 --- a/build_common/tools/UnpackAll.py +++ b/build_common/tools/UnpackAll.py @@ -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"] : diff --git a/extlibs/gtest/SConscript b/extlibs/gtest/SConscript index de39e93..39c0b5f 100644 --- a/extlibs/gtest/SConscript +++ b/extlibs/gtest/SConscript @@ -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') ]) diff --git a/resource/csdk/connectivity/build/SConscript b/resource/csdk/connectivity/build/SConscript index c697fff..a0455d3 100644 --- a/resource/csdk/connectivity/build/SConscript +++ b/resource/csdk/connectivity/build/SConscript @@ -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) diff --git a/resource/csdk/stack/samples/tizen/SimpleClientServer/SConscript b/resource/csdk/stack/samples/tizen/SimpleClientServer/SConscript index 7d05e4b..49e2e68 100644 --- a/resource/csdk/stack/samples/tizen/SimpleClientServer/SConscript +++ b/resource/csdk/stack/samples/tizen/SimpleClientServer/SConscript @@ -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) diff --git a/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/SConscript b/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/SConscript index 5315f4f..b478ff6 100644 --- a/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/SConscript +++ b/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/SConscript @@ -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) diff --git a/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/SConscript b/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/SConscript index b59d4ae..f7fb133 100644 --- a/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/SConscript +++ b/service/easy-setup/sampleapp/enrollee/tizen-sdb/EnrolleeSample/build/SConscript @@ -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) -- 2.7.4