8000 bpo-47205: Skip error check of sched_get/setaffinity on FreeBSD (GH-3… · python/cpython@490ccbd · GitHub
[go: up one dir, main page]

Skip to content

Commit 490ccbd

Browse files
bpo-47205: Skip error check of sched_get/setaffinity on FreeBSD (GH-32285)
(cherry picked from commit b82cdd1) Co-authored-by: Christian Heimes <christian@python.org>
1 parent b509235 commit 490ccbd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Lib/test/test_posix.py

Lines changed: 6 additions & 2 deletions
941C
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,9 @@ def test_sched_getaffinity(self):
11531153
mask = posix.sched_getaffinity(0)
11541154
self.assertIsInstance(mask, set)
11551155
self.assertGreaterEqual(len(mask), 1)
1156-
self.assertRaises(OSError, posix.sched_getaffinity, -1)
1156+
if not sys.platform.startswith("freebsd"):
1157+
# bpo-47205: does not raise OSError on FreeBSD
1158+
self.assertRaises(OSError, posix.sched_getaffinity, -1)
11571159
for cpu in mask:
11581160
self.assertIsInstance(cpu, int)
11591161
self.assertGreaterEqual(cpu, 0)
@@ -1171,7 +1173,9 @@ def test_sched_setaffinity(self):
11711173
self.assertRaises(ValueError, posix.sched_setaffinity, 0, [-10])
11721174
self.assertRaises(ValueError, posix.sched_setaffinity, 0, map(int, "0X"))
11731175
self.assertRaises(OverflowError, posix.sched_setaffinity, 0, [1<<128])
1174-
self.assertRaises(OSError, posix.sched_setaffinity, -1, mask)
1176+
if not sys.platform.startswith("freebsd"):
1177+
# bpo-47205: does not raise OSError on FreeBSD
1178+
self.assertRaises(OSError, posix.sched_setaffinity, -1, mask)
11751179

11761180
def test_rtld_constants(self):
11771181
# check presence of major RTLD_* constants
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Skip test for :func:`~os.sched_getaffinity` and
2+
:func:`~os.sched_setaffinity` error case on FreeBSD.

0 commit comments

Comments
 (0)
0