diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2015-03-28 18:39:51 (GMT) |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-03-28 18:39:51 (GMT) |
| commit | 1770fde94cb2bbcd05f4e3e72e2b78074566f522 (patch) | |
| tree | 310c03e2b8096fff4c9fbdd8db9ff3ae7ba9b63b /Lib/test/lock_tests.py | |
| parent | cb0c60258b9c11b7742b6e1e6d65e33a6c9a3332 (diff) | |
| parent | 9db55004a1bc0c0b3efca69dcd577ff58a86ea16 (diff) | |
| download | cpython-1770fde94cb2bbcd05f4e3e72e2b78074566f522.zip cpython-1770fde94cb2bbcd05f4e3e72e2b78074566f522.tar.gz cpython-1770fde94cb2bbcd05f4e3e72e2b78074566f522.tar.bz2 | |
Make some tests more frienly to MemoryError.
Free memory, unlock hanging threads.
Diffstat (limited to 'Lib/test/lock_tests.py')
| -rw-r--r-- | Lib/test/lock_tests.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/lock_tests.py b/Lib/test/lock_tests.py index 136f1c3..b325bce 100644 --- a/Lib/test/lock_tests.py +++ b/Lib/test/lock_tests.py @@ -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: |
