From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 22 Jul 2026 08:48:25 +0000 (+0200) Subject: [3.15] gh-154441: Skip the scheduler tests if the API requires privileges (GH-154442... X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=731d94d8cad0e8dbeac16c74b2672b1a349fee94;p=thirdparty%2FPython%2Fcpython.git [3.15] gh-154441: Skip the scheduler tests if the API requires privileges (GH-154442) (GH-154447) DragonFly BSD requires privileges to use the scheduler API, even for the calling process. (cherry picked from commit cbd15390e474e254ad2590c57de7e3bf657c0a09) Co-authored-by: Serhiy Storchaka Co-authored-by: Claude Opus 4.8 --- diff --git a/Lib/test/test_os/test_posix.py b/Lib/test/test_os/test_posix.py index c0cbc3e4e2e7..38066a542609 100644 --- a/Lib/test/test_os/test_posix.py +++ b/Lib/test/test_os/test_posix.py @@ -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 @@ -1451,6 +1452,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: