Handle idc.SetType return value correctly.

Apparently, idc.SetType returns True if the type is set for the first
time, False if the type is updated, and None if the type couldn't be set
(rather differently from what the documentation says).
This commit is contained in:
Robert Xiao
2020-04-20 19:31:04 -07:00
committed by Katy
parent 75744a31dc
commit 930202dfdd

View File

@@ -65,7 +65,7 @@ def MakeFunction(start):
def SetType(addr, type): def SetType(addr, type):
ret = idc.SetType(addr, type) ret = idc.SetType(addr, type)
if ret == 0: if ret is None:
print('SetType(0x%x, %r) failed!' % (addr, type)) print('SetType(0x%x, %r) failed!' % (addr, type))
"); ");