Skip to content

Commit cbd1539

Browse files
gh-154441: Skip the scheduler tests if the API requires privileges (GH-154442)
DragonFly BSD requires privileges to use the scheduler API, even for the calling process. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0eac28e commit cbd1539

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/test/test_os/test_posix.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def _supports_sched():
4646
try:
4747
posix.sched_getscheduler(0)
4848
except OSError as e:
49-
if e.errno == errno.ENOSYS:
49+
# DragonFly BSD requires privileges to use the scheduler API.
50+
if e.errno in (errno.ENOSYS, errno.EPERM):
5051
return False
5152
return True
5253

@@ -1453,6 +1454,7 @@ def test_bug_140634(self):
14531454
del sched_priority, param # should not crash
14541455
support.gc_collect() # just to be sure
14551456

1457+
@requires_sched
14561458
@unittest.skipUnless(hasattr(posix, "sched_rr_get_interval"), "no function")
14571459
def test_sched_rr_get_interval(self):
14581460
try:

0 commit comments

Comments
 (0)