]> granicus.if.org Git - python/commitdiff
fix exception usage
authorAndrew MacIntyre <andymac@bullseye.apana.org.au>
Tue, 13 Jun 2006 17:14:36 +0000 (17:14 +0000)
committerAndrew MacIntyre <andymac@bullseye.apana.org.au>
Tue, 13 Jun 2006 17:14:36 +0000 (17:14 +0000)
Lib/dummy_thread.py
Lib/test/test_thread.py

index 7c26f9e5ef00f8c0b7a2b3d80a5938b5fffd4a00..a72c92722f4fd2527d16c1eb484059993e6d31f9 100644 (file)
@@ -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):
index 7b523e2cec709435d9282e96068cf262185838a2..7586ebce25a809fd9751b66888e4b163484497aa 100644 (file)
@@ -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'