From: Benjamin Peterson Date: Tue, 2 Aug 2011 23:48:59 +0000 (-0500) Subject: bsd doesn't like letting normal processes set the scheduler X-Git-Tag: v3.3.0a1~1762 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18592ca58916e3e1526a84dad8652a5329fefa08;p=thirdparty%2FPython%2Fcpython.git bsd doesn't like letting normal processes set the scheduler --- diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index a0fefbc98a76..3fe791b01182 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -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)