Make some tests more frienly to MemoryError.

Free memory, unlock hanging threads.
This commit is contained in:
Serhiy Storchaka 2015-03-28 20:38:37 +02:00
parent d7aa5248fb
commit 9db55004a1
6 changed files with 43 additions and 16 deletions

View file

@ -39,8 +39,12 @@ class Bunch(object):
self.finished.append(tid)
while not self._can_exit:
_wait()
for i in range(n):
start_new_thread(task, ())
try:
for i in range(n):
start_new_thread(task, ())
except:
self._can_exit = True
raise
def wait_for_started(self):
while len(self.started) < self.n: