Skip to content

Commit f6eadb5

Browse files
miss-islingtonserhiy-storchakaclaude
authored
[3.13] gh-154441: Skip the scheduler tests if the API requires privileges (GH-154442) (GH-154449)
DragonFly BSD requires privileges to use the scheduler API, even for the calling process. (cherry picked from commit cbd1539) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d1466cc commit f6eadb5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/test/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

@@ -1390,6 +1391,7 @@ def test_bug_140634(self):
13901391
del sched_priority, param # should not crash
13911392
support.gc_collect() # just to be sure
13921393

1394+
@requires_sched
13931395
@unittest.skipUnless(hasattr(posix, "sched_rr_get_interval"), "no function")
13941396
def test_sched_rr_get_interval(self):
13951397
try:

0 commit comments

Comments
 (0)