about summary refs log tree commit diff stats
path: root/test/utils/multithread.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/utils/multithread.py
parenteab809932871f91d6f4aa770fc321af9e156e0f5 (diff)
downloadfocaccia-miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.tar.gz
focaccia-miasm-02bbb30efea4980c9d133947cbbf69fb599071ad.zip
Support python2/python3
Diffstat (limited to 'test/utils/multithread.py')
-rw-r--r--test/utils/multithread.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/test/utils/multithread.py b/test/utils/multithread.py
index 287b5ebd..d0874dd1 100644
--- a/test/utils/multithread.py
+++ b/test/utils/multithread.py
@@ -1,24 +1,25 @@
+from __future__ import print_function
 import sys
-import cosmetics
+from . import cosmetics
 import time
 
 
 def task_done(test, error, test_ok, test_ko):
     command_line = " ".join(test.command_line)
     if error is not None:
-        print cosmetics.colors["red"] + 'ERROR',
-        print cosmetics.colors["lightcyan"] + command_line + cosmetics.colors["end"]
-        print error
+        print(cosmetics.colors["red"] + 'ERROR', end=' ')
+        print(cosmetics.colors["lightcyan"] + command_line + cosmetics.colors["end"])
+        print(error)
         test_ko.append((test, error))
     else:
-        print cosmetics.colors["green"] + 'DONE',
-        print cosmetics.colors["lightcyan"] + command_line + cosmetics.colors["end"],
-        print "%ds" % (time.time() - test.start_time)
+        print(cosmetics.colors["green"] + 'DONE', end=' ')
+        print(cosmetics.colors["lightcyan"] + command_line + cosmetics.colors["end"], end=' ')
+        print("%ds" % (time.time() - test.start_time))
         test_ok.append((test, error))
 
 
 def task_new(test):
     command_line = " ".join(test.command_line)
-    print cosmetics.colors["lightcyan"],
-    print test.base_dir.upper(), command_line,
-    print cosmetics.colors["end"]
+    print(cosmetics.colors["lightcyan"], end=' ')
+    print(test.base_dir.upper(), command_line, end=' ')
+    print(cosmetics.colors["end"])