]> granicus.if.org Git - python/commitdiff
bsd doesn't like letting normal processes set the scheduler
authorBenjamin Peterson <benjamin@python.org>
Tue, 2 Aug 2011 23:48:59 +0000 (18:48 -0500)
committerBenjamin Peterson <benjamin@python.org>
Tue, 2 Aug 2011 23:48:59 +0000 (18:48 -0500)
Lib/test/test_posix.py

index a0fefbc98a766f97f7d24667706d8f94ab9a4e64..3fe791b01182faae22cd6b3a96556c7b6d587a14 100644 (file)
@@ -868,7 +868,11 @@ class PosixTester(unittest.TestCase):
         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)