about summary refs log tree commit diff stats
path: root/test/arch/mips32/arch.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2019-02-25 11:09:54 +0100
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2019-03-05 16:52:49 +0100
commit02bbb30efea4980c9d133947cbbf69fb599071ad (patch)
tree3fea6826fcc5354840a27cb1dc99ff31eef81896 /test/arch/mips32/arch.py
parenteab809932871f91d6f4aa770fc321af9e156e0f5 (diff)
downloadmiasm-02bbb30efea4980c9d133947cbbf69fb599071ad.tar.gz
miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.zip
Support python2/python3
Diffstat (limited to 'test/arch/mips32/arch.py')
-rw-r--r--test/arch/mips32/arch.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/arch/mips32/arch.py b/test/arch/mips32/arch.py
index 1cbb554d..f71d3ee8 100644
--- a/test/arch/mips32/arch.py
+++ b/test/arch/mips32/arch.py
@@ -1,6 +1,8 @@
+from __future__ import print_function
 import time
 from pdb import pm
 
+from miasm2.core.utils import decode_hex, encode_hex
 from miasm2.core.locationdb import LocationDB
 from miasm2.arch.mips32.arch import *
 
@@ -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)