[Python-checkins] cpython: handle sched_rr_get_interval not working on current

benjamin.peterson python-checkins at python.org
Wed Aug 3 05:19:24 CEST 2011


http://hg.python.org/cpython/rev/4862df5cbedb
changeset:   71726:4862df5cbedb
user:        Benjamin Peterson <benjamin at python.org>
date:        Tue Aug 02 22:19:14 2011 -0500
summary:
  handle sched_rr_get_interval not working on current

files:
  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
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -890,7 +890,14 @@
 
     @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.)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list