diff options
| author | Camille Mougey <commial@gmail.com> | 2019-03-07 14:37:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-07 14:37:07 +0100 |
| commit | 4c2320b46250a8d6f8774e1218544b72a154cd8e (patch) | |
| tree | b67e7b072439f84109bd39dad8ed7f3f135224f8 /test/arch/mips32/arch.py | |
| parent | eab809932871f91d6f4aa770fc321af9e156e0f5 (diff) | |
| parent | 26c1075723a02984da6d3bc7423c5c0c43082dc3 (diff) | |
| download | miasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.tar.gz miasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.zip | |
Merge pull request #990 from serpilliere/support_python2_python3
Support python2 python3
Diffstat (limited to 'test/arch/mips32/arch.py')
| -rw-r--r-- | test/arch/mips32/arch.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/test/arch/mips32/arch.py b/test/arch/mips32/arch.py index 1cbb554d..e5e8cff6 100644 --- a/test/arch/mips32/arch.py +++ b/test/arch/mips32/arch.py @@ -1,8 +1,10 @@ +from __future__ import print_function import time from pdb import pm -from miasm2.core.locationdb import LocationDB -from miasm2.arch.mips32.arch import * +from miasm.core.utils import decode_hex, encode_hex +from miasm.core.locationdb import LocationDB +from miasm.arch.mips32.arch import * loc_db = LocationDB() @@ -217,20 +219,20 @@ reg_tests_mips32 = [ ts = time.time() def h2i(s): - return s.replace(' ', '').decode('hex') + return decode_hex(s.replace(' ', '')) for s, l in reg_tests_mips32: - print "-" * 80 + print("-" * 80) s = s[12:] b = h2i((l)) mn = mn_mips32.dis(b, 'b') - print [str(x) for x in mn.args] - print s - print mn + print([str(x) for x in mn.args]) + print(s) + print(mn) assert(str(mn) == s) l = mn_mips32.fromstring(s, loc_db, 'b') assert(str(l) == s) a = mn_mips32.asm(l, 'b') - print [x for x in a] - print repr(b) + print([x for x in a]) + print(repr(b)) assert(b in a) |