diff --git a/src/stub/scripts/bin2h.py b/src/stub/scripts/bin2h.py index be677501..65b1dcd3 100644 --- a/src/stub/scripts/bin2h.py +++ b/src/stub/scripts/bin2h.py @@ -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 diff --git a/src/stub/scripts/xstrip.py b/src/stub/scripts/xstrip.py index 1de4f087..cf07c302 100644 --- a/src/stub/scripts/xstrip.py +++ b/src/stub/scripts/xstrip.py @@ -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) diff --git a/src/stub/src/arch/i086/cleanasm.py b/src/stub/src/arch/i086/cleanasm.py index 1061ef7c..f5a830c9 100644 --- a/src/stub/src/arch/i086/cleanasm.py +++ b/src/stub/src/arch/i086/cleanasm.py @@ -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]))