Kaydet (Commit) a7090dfc authored tarafından Andrew MacIntyre's avatar Andrew MacIntyre

fix exception usage

üst 573bd19e
...@@ -79,8 +79,7 @@ def allocate_lock(): ...@@ -79,8 +79,7 @@ def allocate_lock():
def stack_size(size=None): def stack_size(size=None):
"""Dummy implementation of thread.stack_size().""" """Dummy implementation of thread.stack_size()."""
if size is not None: if size is not None:
msg = "setting thread stack size not supported on this platform" raise error("setting thread stack size not supported")
warnings.warn(msg, RuntimeWarning)
return 0 return 0
class LockType(object): class LockType(object):
......
...@@ -133,7 +133,7 @@ if os_name in ("nt", "os2", "posix"): ...@@ -133,7 +133,7 @@ if os_name in ("nt", "os2", "posix"):
thread.stack_size(4096) thread.stack_size(4096)
except ValueError: except ValueError:
print 'caught expected ValueError setting stack_size(4096)' print 'caught expected ValueError setting stack_size(4096)'
except thread.ThreadError: except thread.error:
tss_supported = 0 tss_supported = 0
print 'platform does not support changing thread stack size' print 'platform does not support changing thread stack size'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment