]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-154441: Skip the scheduler tests if the API requires privileges (GH-154442)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 22 Jul 2026 08:15:22 +0000 (11:15 +0300)
committerGitHub <noreply@github.com>
Wed, 22 Jul 2026 08:15:22 +0000 (08:15 +0000)
DragonFly BSD requires privileges to use the scheduler API, even for
the calling process.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_os/test_posix.py

index 79e234cbcd2ae258b1f58d3fdae752586d36fa52..299ab9774fc812c732864840c28c7ff7e2a06909 100644 (file)
@@ -46,7 +46,8 @@ def _supports_sched():
     try:
         posix.sched_getscheduler(0)
     except OSError as e:
-        if e.errno == errno.ENOSYS:
+        # DragonFly BSD requires privileges to use the scheduler API.
+        if e.errno in (errno.ENOSYS, errno.EPERM):
             return False
     return True
 
@@ -1453,6 +1454,7 @@ class PosixTester(unittest.TestCase):
         del sched_priority, param  # should not crash
         support.gc_collect()  # just to be sure
 
+    @requires_sched
     @unittest.skipUnless(hasattr(posix, "sched_rr_get_interval"), "no function")
     def test_sched_rr_get_interval(self):
         try: