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 ...@@ -16,6 +16,8 @@ from util import log
TIMEOUT = 180 TIMEOUT = 180
NWORKERS = int(os.environ.get('NWORKERS') or max(cpu_count() - 1, 4)) 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 # tests that don't do well when run on busy box
......
...@@ -25,8 +25,11 @@ class Thread(threading.Thread): ...@@ -25,8 +25,11 @@ class Thread(threading.Thread):
def run(self): def run(self):
target = getattr(self, '_target', None) # Py3 target = getattr(self, '_target', None) # Py3
if target is None: if target is None:
target = getattr(self, '_Thread__target', None) target = getattr(self, '_Thread__target')
self.value = target(*self._args) args = getattr(self, '_Thread__args')
else:
args = self._args
self.value = target(*args)
do_exec = None do_exec = None
if sys.version_info >= (3, 0): 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