about summary refs log tree commit diff stats
path: root/test/arch/mep/ir/ut_helpers_ir.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/mep/ir/ut_helpers_ir.py
parenteab809932871f91d6f4aa770fc321af9e156e0f5 (diff)
downloadmiasm-02bbb30efea4980c9d133947cbbf69fb599071ad.tar.gz
miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.zip
Support python2/python3
Diffstat (limited to 'test/arch/mep/ir/ut_helpers_ir.py')
-rw-r--r--test/arch/mep/ir/ut_helpers_ir.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/arch/mep/ir/ut_helpers_ir.py b/test/arch/mep/ir/ut_helpers_ir.py
index 9c9efdfa..26eebeda 100644
--- a/test/arch/mep/ir/ut_helpers_ir.py
+++ b/test/arch/mep/ir/ut_helpers_ir.py
@@ -1,6 +1,8 @@
 # Toshiba MeP-c4 - unit tests helpers
 # Guillaume Valadon <guillaume@valadon.net>
 
+from __future__ import print_function
+
 from miasm2.arch.mep.arch import mn_mep
 from miasm2.arch.mep.sem import ir_mepb
 from miasm2.arch.mep.regs import regs_init
@@ -10,7 +12,8 @@ from miasm2.core.locationdb import LocationDB
 from miasm2.core.utils import Disasm_Exception
 from miasm2.ir.ir import AssignBlock
 from miasm2.arch.mep.ira import ir_a_mepb
-from miasm2.expression.expression import ExprId, ExprInt, ExprOp, ExprMem, ExprAssign, ExprLoc
+from miasm2.expression.expression import ExprId, ExprInt, ExprOp, ExprMem, \
+    ExprAssign, ExprLoc
 
 
 def exec_instruction(mn_str, init_values, results, index=0, offset=0):
@@ -67,8 +70,8 @@ def exec_instruction(mn_str, init_values, results, index=0, offset=0):
 
     # Ensure that all expected results were verified
     if len(results) is not matched_results:
-        print "Expected:", results
-        print "Modified:", [r for r in sb.modified(mems=False)]
+        print("Expected:", results)
+        print("Modified:", [r for r in sb.modified(mems=False)])
         assert(False)
 
 
@@ -78,10 +81,10 @@ def launch_tests(obj):
     test_methods = [name for name in dir(obj) if name.startswith("test")]
 
     for method in test_methods:
-        print method
+        print(method)
         try:
             getattr(obj, method)()
         except AttributeError as e:
-            print "Method not found: %s" % method
+            print("Method not found: %s" % method)
             assert(False)
-        print '-' * 42
+        print('-' * 42)