From 34d627e24d4a5ff609492b930a58881f6918d249 Mon Sep 17 00:00:00 2001 From: Andrew Featherstone Date: Wed, 20 Dec 2017 16:36:22 +0000 Subject: Threading module should definitely be present. Don't try and soldier on without it. --- runtest.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/runtest.py b/runtest.py index 487100b..99e1d6b 100755 --- a/runtest.py +++ b/runtest.py @@ -88,17 +88,11 @@ import stat import sys import time -try: - import threading - try: # python3 - from queue import Queue - except ImportError as e: # python2 - from Queue import Queue - threading_ok = True -except ImportError: - print("Can't import threading or queue") - threading_ok = False - +import threading +try: # python3 + from queue import Queue +except ImportError as e: # python2 + from Queue import Queue import subprocess @@ -850,7 +844,7 @@ class RunTest(threading.Thread): run_test(t, io_lock, True) self.queue.task_done() -if jobs > 1 and threading_ok: +if jobs > 1: print("Running tests using %d jobs"%jobs) # Start worker threads queue = Queue() @@ -864,9 +858,6 @@ if jobs > 1 and threading_ok: queue.put(t) queue.join() else: - # Run tests serially - if jobs > 1: - print("Ignoring -j%d option; no python threading module available."%jobs) for t in tests: run_test(t, None, False) -- cgit v0.12