From 9d3fb35f87a5171099dee471bcf3be02d0a7f851 Mon Sep 17 00:00:00 2001 From: "gergely.erdelyi" Date: Sat, 17 Oct 2009 20:54:08 +0000 Subject: [PATCH] has_key() is slowly getting deprecated. Might make sense to stop using it. --- build.py | 4 ++-- python/idc.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index 385e736..03ad1c7 100644 --- a/build.py +++ b/build.py @@ -22,8 +22,8 @@ from distutils import sysconfig # Start of user configurable options VERBOSE = True IDA_MAJOR_VERSION = 5 -IDA_MINOR_VERSION = 4 -if os.environ.has_key('IDA'): +IDA_MINOR_VERSION = 5 +if 'IDA' in os.environ: IDA_SDK = os.environ['IDA'] else: IDA_SDK = ".." + os.sep + "swigsdk-versions" + os.sep + "%d.%d" % (IDA_MAJOR_VERSION, IDA_MINOR_VERSION) diff --git a/python/idc.py b/python/idc.py index 117b256..ee8a446 100644 --- a/python/idc.py +++ b/python/idc.py @@ -1471,7 +1471,7 @@ def SetRegEx(ea, reg, value, tag): See also SetReg() compatibility macro. """ - if _REGMAP.has_key(reg): + if reg in _REGMAP: return idaapi.splitSRarea1(ea, _REGMAP[reg], value, tag) else: return False @@ -1889,7 +1889,7 @@ def GetReg(ea, reg): so to get paragraph pointed by the segment register you need to call AskSelector() function. """ - if _REGMAP.has_key(reg): + if reg in _REGMAP: return idaapi.getSR(ea, _REGMAP[reg]) & 0xFFFF else: return False @@ -3340,7 +3340,7 @@ def SetSegDefReg(ea, reg, value): """ seg = idaapi.getseg(ea) - if seg and _REGMAP.has_key(reg): + if seg and reg in _REGMAP: return idaapi.SetDefaultRegisterValue(seg, _REGMAP[reg], value) else: return False