From a7090dfc2c97a788a8c8c63975ee54c261d03998 Mon Sep 17 00:00:00 2001 From: Andrew MacIntyre Date: Tue, 13 Jun 2006 17:14:36 +0000 Subject: fix exception usage --- Lib/dummy_thread.py | 3 +-- Lib/test/test_thread.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Lib/dummy_thread.py b/Lib/dummy_thread.py index 7c26f9e..a72c927 100644 --- a/Lib/dummy_thread.py +++ b/Lib/dummy_thread.py @@ -79,8 +79,7 @@ def allocate_lock(): def stack_size(size=None): """Dummy implementation of thread.stack_size().""" if size is not None: - msg = "setting thread stack size not supported on this platform" - warnings.warn(msg, RuntimeWarning) + raise error("setting thread stack size not supported") return 0 class LockType(object): diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py index 7b523e2..7586ebc 100644 --- a/Lib/test/test_thread.py +++ b/Lib/test/test_thread.py @@ -133,7 +133,7 @@ if os_name in ("nt", "os2", "posix"): thread.stack_size(4096) except ValueError: print 'caught expected ValueError setting stack_size(4096)' - except thread.ThreadError: + except thread.error: tss_supported = 0 print 'platform does not support changing thread stack size' -- cgit v0.12