Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 43234ab

Browse files
committed
handle sched_rr_get_interval not working on current
1 parent 50ba271 commit 43234ab

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Lib/test/test_posix.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,14 @@ def test_get_and_set_scheduler_and_param(self):
890890

891891
@unittest.skipUnless(hasattr(posix, "sched_rr_get_interval"), "no function")
892892
def test_sched_rr_get_interval(self):
893-
interval = posix.sched_rr_get_interval(0)
893+
try:
894+
interval = posix.sched_rr_get_interval(0)
895+
except OSError as e:
896+
# This likely means that sched_rr_get_interval is only valid for
897+
# processes with the SCHED_RR scheduler in effect.
898+
if e.errno != errno.EINVAL:
899+
raise
900+
self.skipTest("only works on SCHED_RR processes")
894901
self.assertIsInstance(interval, float)
895902
# Reasonable constraints, I think.
896903
self.assertGreaterEqual(interval, 0.)

0 commit comments

Comments
 (0)