Replace 'has_key' with 'in'
modified: src/stub/scripts/bin2h.py modified: src/stub/scripts/xstrip.py modified: src/stub/src/arch/i086/cleanasm.py
This commit is contained in:
parent
59d5d25a77
commit
a3d5a0a7b8
@ -326,7 +326,7 @@ def main(argv):
|
||||
r_methods.reverse()
|
||||
for method in r_methods:
|
||||
method, odata = compress_stub(method, idata)
|
||||
if mdata_odata.has_key(method):
|
||||
if method in mdata_odata:
|
||||
assert mdata_odata[method] == odata
|
||||
else:
|
||||
mdata_odata[method] = odata
|
||||
|
||||
@ -88,7 +88,7 @@ def check_dump(dump_fn):
|
||||
assert int(f[0], 10) == len(sections)
|
||||
e = f[1], int(f[2], 16), int(f[5], 16), int(f[6][3:], 10), len(sections)
|
||||
sections.append(e)
|
||||
assert not section_names.has_key(e[0]), e
|
||||
assert not e[0] in section_names, e
|
||||
assert not e[0].endswith(":"), ("bad section name", e)
|
||||
section_names[e[0]] = e
|
||||
##print (sections)
|
||||
|
||||
@ -99,11 +99,11 @@ def main(argv):
|
||||
k, v = m.group(1).strip(), [0, 0, None, 0]
|
||||
assert k and v, (inst, args)
|
||||
v[2] = k # new name
|
||||
if labels.has_key(k):
|
||||
if k in labels:
|
||||
assert labels[k][:2] == v[:2]
|
||||
return k, v
|
||||
def add_label(k, v):
|
||||
if labels.has_key(k):
|
||||
if k in labels:
|
||||
assert labels[k][:2] == v[:2]
|
||||
else:
|
||||
labels[k] = v
|
||||
@ -449,7 +449,7 @@ def main(argv):
|
||||
ofp = open(ofile, "wb")
|
||||
current_label = None
|
||||
for label, inst, args, args_label in olines:
|
||||
if labels.has_key(label):
|
||||
if label in labels:
|
||||
current_label = labels[label][2]
|
||||
if opts.verbose:
|
||||
ofp.write("%s: /* %d */\n" % (labels[label][2], labels[label][3]))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user