diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-08-02 23:48:59 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-08-02 23:48:59 (GMT) |
commit | 18592ca58916e3e1526a84dad8652a5329fefa08 (patch) | |
tree | b5d06f78d854aa76936552dae63692e49623ad34 /Lib | |
parent | bad9c2f13ae2d1b7af3d64506b2ab1ad7850d20a (diff) | |
download | cpython-18592ca58916e3e1526a84dad8652a5329fefa08.zip cpython-18592ca58916e3e1526a84dad8652a5329fefa08.tar.gz cpython-18592ca58916e3e1526a84dad8652a5329fefa08.tar.bz2 |
bsd doesn't like letting normal processes set the scheduler
Diffstat (limited to 'Lib')
-rw-r--r-- | 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 index a0fefbc..3fe791b 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) |