[Python-checkins] cpython (merge default -> default): merge heads

eli.bendersky python-checkins at python.org
Sun Jan 13 14:18:22 CET 2013


http://hg.python.org/cpython/rev/05cacbd2f545
changeset:   81481:05cacbd2f545
parent:      81480:0b3ebb344a8a
parent:      81478:3c67bd5abe38
user:        Eli Bendersky <eliben at gmail.com>
date:        Sun Jan 13 05:16:36 2013 -0800
summary:
  merge heads

files:
  Lib/test/test_asyncore.py |   2 +-
  Lib/test/test_posix.py    |  20 ++++++++++----------
  2 files changed, 11 insertions(+), 11 deletions(-)


diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -789,7 +789,7 @@
             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
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -930,17 +930,17 @@
         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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list