has_key() is slowly getting deprecated. Might make sense to stop using it.

This commit is contained in:
gergely.erdelyi 2009-10-17 20:54:08 +00:00
parent bbf6b2e547
commit 9d3fb35f87
2 changed files with 5 additions and 5 deletions

View File

@ -22,8 +22,8 @@ from distutils import sysconfig
# Start of user configurable options # Start of user configurable options
VERBOSE = True VERBOSE = True
IDA_MAJOR_VERSION = 5 IDA_MAJOR_VERSION = 5
IDA_MINOR_VERSION = 4 IDA_MINOR_VERSION = 5
if os.environ.has_key('IDA'): if 'IDA' in os.environ:
IDA_SDK = os.environ['IDA'] IDA_SDK = os.environ['IDA']
else: else:
IDA_SDK = ".." + os.sep + "swigsdk-versions" + os.sep + "%d.%d" % (IDA_MAJOR_VERSION, IDA_MINOR_VERSION) IDA_SDK = ".." + os.sep + "swigsdk-versions" + os.sep + "%d.%d" % (IDA_MAJOR_VERSION, IDA_MINOR_VERSION)

View File

@ -1471,7 +1471,7 @@ def SetRegEx(ea, reg, value, tag):
See also SetReg() compatibility macro. See also SetReg() compatibility macro.
""" """
if _REGMAP.has_key(reg): if reg in _REGMAP:
return idaapi.splitSRarea1(ea, _REGMAP[reg], value, tag) return idaapi.splitSRarea1(ea, _REGMAP[reg], value, tag)
else: else:
return False return False
@ -1889,7 +1889,7 @@ def GetReg(ea, reg):
so to get paragraph pointed by the segment register you need to so to get paragraph pointed by the segment register you need to
call AskSelector() function. call AskSelector() function.
""" """
if _REGMAP.has_key(reg): if reg in _REGMAP:
return idaapi.getSR(ea, _REGMAP[reg]) & 0xFFFF return idaapi.getSR(ea, _REGMAP[reg]) & 0xFFFF
else: else:
return False return False
@ -3340,7 +3340,7 @@ def SetSegDefReg(ea, reg, value):
""" """
seg = idaapi.getseg(ea) seg = idaapi.getseg(ea)
if seg and _REGMAP.has_key(reg): if seg and reg in _REGMAP:
return idaapi.SetDefaultRegisterValue(seg, _REGMAP[reg], value) return idaapi.SetDefaultRegisterValue(seg, _REGMAP[reg], value)
else: else:
return False return False