Commit c51a2fc5 authored by Jason Madden's avatar Jason Madden

fix thread creation on py27

parent d0be3cba
......@@ -16,6 +16,8 @@ from util import log
TIMEOUT = 180
NWORKERS = int(os.environ.get('NWORKERS') or max(cpu_count() - 1, 4))
if NWORKERS > 10:
NWORKERS = 10
# tests that don't do well when run on busy box
......
......@@ -25,8 +25,11 @@ class Thread(threading.Thread):
def run(self):
target = getattr(self, '_target', None) # Py3
if target is None:
target = getattr(self, '_Thread__target', None)
self.value = target(*self._args)
target = getattr(self, '_Thread__target')
args = getattr(self, '_Thread__args')
else:
args = self._args
self.value = target(*args)
do_exec = None
if sys.version_info >= (3, 0):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment