[Python-checkins] cpython: bsd doesn't like letting normal processes set the scheduler

benjamin.peterson python-checkins at python.org
Wed Aug 3 01:49:50 CEST 2011


http://hg.python.org/cpython/rev/fce751202cba
changeset:   71718:fce751202cba
parent:      71713:c39804f08e90
user:        Benjamin Peterson <benjamin at python.org>
date:        Tue Aug 02 18:48:59 2011 -0500
summary:
  bsd doesn't like letting normal processes set the scheduler

files:
  Lib/test/test_posix.py |  6 +++++-
  1 files changed, 5 insertions(+), 1 deletions(-)


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
@@ -868,7 +868,11 @@
         self.assertRaises(OSError, posix.sched_getparam, -1)
         param = posix.sched_getparam(0)
         self.assertIsInstance(param.sched_priority, int)
-        posix.sched_setscheduler(0, mine, param)
+        try:
+            posix.sched_setscheduler(0, mine, param)
+        except OSError as e:
+            if e.errno != errno.EPERM:
+                raise
         posix.sched_setparam(0, param)
         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