summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-01-13 13:16:36 (GMT)
committerEli Bendersky <eliben@gmail.com>2013-01-13 13:16:36 (GMT)
commit03f0e57fea664df72c7c4059bc1a7c937b1ed106 (patch)
tree11f529c4a54b0c97e154716f8b87a44889fbf4d5 /Lib/test
parent3ed84421efd8ac9247fa84c87d4a2252f291b7e0 (diff)
parentb402a5c01b2010fc2409e5cb137cde86c4b6cbf3 (diff)
downloadcpython-03f0e57fea664df72c7c4059bc1a7c937b1ed106.zip
cpython-03f0e57fea664df72c7c4059bc1a7c937b1ed106.tar.gz
cpython-03f0e57fea664df72c7c4059bc1a7c937b1ed106.tar.bz2
merge heads
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_asyncore.py2
-rw-r--r--Lib/test/test_posix.py20
2 files changed, 11 insertions, 11 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index 19b902b..57eb4fa 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -789,7 +789,7 @@ class BaseTestAPI:
t = threading.Thread(target=lambda: asyncore.loop(timeout=0.1,
count=500))
t.start()
-
+ self.addCleanup(t.join)
s = socket.socket(self.family, socket.SOCK_STREAM)
s.settimeout(.2)
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index ebad4ea..1352943 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -930,17 +930,17 @@ class PosixTester(unittest.TestCase):
self.assertRaises(OSError, posix.sched_getparam, -1)
param = posix.sched_getparam(0)
self.assertIsInstance(param.sched_priority, int)
- try:
- posix.sched_setscheduler(0, mine, param)
- except OSError as e:
- if e.errno != errno.EPERM:
- 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)
+ # 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:
+ posix.sched_setscheduler(0, mine, param)
+ posix.sched_setparam(0, param)
+ except OSError as e:
+ if e.errno != errno.EPERM:
+ raise
self.assertRaises(OSError, posix.sched_setparam, -1, param)
self.assertRaises(OSError, posix.sched_setscheduler, -1, mine, param)