about summary refs log tree commit diff stats
path: root/test/utils/testset.py
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2019-03-07 14:37:07 +0100
committerGitHub <noreply@github.com>2019-03-07 14:37:07 +0100
commit4c2320b46250a8d6f8774e1218544b72a154cd8e (patch)
treeb67e7b072439f84109bd39dad8ed7f3f135224f8 /test/utils/testset.py
parenteab809932871f91d6f4aa770fc321af9e156e0f5 (diff)
parent26c1075723a02984da6d3bc7423c5c0c43082dc3 (diff)
downloadmiasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.tar.gz
miasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.zip
Merge pull request #990 from serpilliere/support_python2_python3
Support python2 python3
Diffstat (limited to 'test/utils/testset.py')
-rw-r--r--test/utils/testset.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/utils/testset.py b/test/utils/testset.py
index 7b60e836..eee0e6f7 100644
--- a/test/utils/testset.py
+++ b/test/utils/testset.py
@@ -1,10 +1,12 @@
+from __future__ import print_function
+from builtins import range
 import os
 import subprocess
 import sys
 import time
 from multiprocessing import cpu_count, Queue, Process
 
-from test import Test
+from .test import Test
 
 
 class Message(object):
@@ -136,7 +138,7 @@ class TestSet(object):
 
         if len(self.tests) == 0:
             # Poison pills
-            for _ in xrange(self.cpu_c):
+            for _ in range(self.cpu_c):
                 self.todo_queue.put(None)
 
         # All tasks done
@@ -201,7 +203,7 @@ class TestSet(object):
             try:
                 os.remove(product)
             except OSError:
-                print "Cleanning error: Unable to remove %s" % product
+                print("Cleanning error: Unable to remove %s" % product)
 
     def add_additional_args(self, args):
         """Add arguments to used on the test command line
@@ -218,7 +220,7 @@ class TestSet(object):
 
         # Launch workers
         processes = []
-        for _ in xrange(self.cpu_c):
+        for _ in range(self.cpu_c):
             p = Process(target=TestSet.worker, args=(self.todo_queue,
                                                      self.message_queue,
                                                      self.additional_args))