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/msp430/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/msp430/arch.py')
| -rw-r--r-- | test/arch/msp430/arch.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/test/arch/msp430/arch.py b/test/arch/msp430/arch.py index 91de95b3..bc38c363 100644 --- a/test/arch/msp430/arch.py +++ b/test/arch/msp430/arch.py @@ -1,12 +1,15 @@ +from __future__ import print_function + import time from pdb import pm -from miasm2.arch.msp430.arch import * -from miasm2.core.locationdb import LocationDB +from miasm.core.utils import decode_hex, encode_hex +from miasm.arch.msp430.arch import * +from miasm.core.locationdb import LocationDB loc_db = LocationDB() def h2i(s): - return s.replace(' ', '').decode('hex') + return decode_hex(s.replace(' ', '')) def u16swap(i): @@ -86,18 +89,18 @@ reg_tests_msp = [ ts = time.time() for s, l in reg_tests_msp: - print "-" * 80 + print("-" * 80) s = s[8:] b = h2i((l)) - print repr(b) + print(repr(b)) mn = mn_msp430.dis(b, None) - 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_msp430.fromstring(s, loc_db, None) assert(str(l) == s) a = mn_msp430.asm(l) - print [x for x in a] - print repr(b) + print([x for x in a]) + print(repr(b)) assert(b in a) |