diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-08-03 03:19:14 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-08-03 03:19:14 (GMT) |
commit | 43234ab685996fc2d1ded4863986a797c1453853 (patch) | |
tree | ef75a5f34bda2baee954f2d691ba429d0b637221 | |
parent | 50ba271dbbaf21a4eba461d84d005bbf52b5eb20 (diff) | |
download | cpython-43234ab685996fc2d1ded4863986a797c1453853.zip cpython-43234ab685996fc2d1ded4863986a797c1453853.tar.gz cpython-43234ab685996fc2d1ded4863986a797c1453853.tar.bz2 |
handle sched_rr_get_interval not working on current
-rw-r--r-- | Lib/test/test_posix.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index e370532..af64a6f 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -890,7 +890,14 @@ class PosixTester(unittest.TestCase): @unittest.skipUnless(hasattr(posix, "sched_rr_get_interval"), "no function") def test_sched_rr_get_interval(self): - interval = posix.sched_rr_get_interval(0) + try: + interval = posix.sched_rr_get_interval(0) + except OSError as e: + # This likely means that sched_rr_get_interval is only valid for + # processes with the SCHED_RR scheduler in effect. + if e.errno != errno.EINVAL: + raise + self.skipTest("only works on SCHED_RR processes") self.assertIsInstance(interval, float) # Reasonable constraints, I think. self.assertGreaterEqual(interval, 0.) |