merge heads

This commit is contained in:
Eli Bendersky 2013-01-13 05:17:19 -08:00
commit 253a843f15
2 changed files with 11 additions and 11 deletions

View File

@ -789,7 +789,7 @@ class BaseTestAPI:
t = threading.Thread(target=lambda: asyncore.loop(timeout=0.1, t = threading.Thread(target=lambda: asyncore.loop(timeout=0.1,
count=500)) count=500))
t.start() t.start()
self.addCleanup(t.join)
s = socket.socket(self.family, socket.SOCK_STREAM) s = socket.socket(self.family, socket.SOCK_STREAM)
s.settimeout(.2) s.settimeout(.2)

View File

@ -930,17 +930,17 @@ class PosixTester(unittest.TestCase):
self.assertRaises(OSError, posix.sched_getparam, -1) self.assertRaises(OSError, posix.sched_getparam, -1)
param = posix.sched_getparam(0) param = posix.sched_getparam(0)
self.assertIsInstance(param.sched_priority, int) self.assertIsInstance(param.sched_priority, int)
# POSIX states that calling sched_setparam() or sched_setscheduler() on
# a process with a scheduling policy other than SCHED_FIFO or SCHED_RR
# is implementation-defined: NetBSD and FreeBSD can return EINVAL.
if not sys.platform.startswith(('freebsd', 'netbsd')):
try: try:
posix.sched_setscheduler(0, mine, param) posix.sched_setscheduler(0, mine, param)
posix.sched_setparam(0, param)
except OSError as e: except OSError as e:
if e.errno != errno.EPERM: if e.errno != errno.EPERM:
raise raise
# POSIX states that calling sched_setparam() on a process with a
# scheduling policy other than SCHED_FIFO or SCHED_RR is
# implementation-defined: FreeBSD returns EINVAL.
if not sys.platform.startswith('freebsd'):
posix.sched_setparam(0, param)
self.assertRaises(OSError, posix.sched_setparam, -1, param) self.assertRaises(OSError, posix.sched_setparam, -1, param)
self.assertRaises(OSError, posix.sched_setscheduler, -1, mine, param) self.assertRaises(OSError, posix.sched_setscheduler, -1, mine, param)