Make some tests more frienly to MemoryError.

Free memory, unlock hanging threads.
This commit is contained in:
Serhiy Storchaka 2015-03-28 20:39:51 +02:00
commit 1770fde94c
6 changed files with 42 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: