mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
bpo-47205: Skip error check of sched_get/setaffinity on FreeBSD (GH-32285)
(cherry picked from commit b82cdd1dac)
Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
a5c90784be
commit
470dfe20cb
2 changed files with 8 additions and 2 deletions
|
|
@ -1179,7 +1179,9 @@ def test_sched_getaffinity(self):
|
|||
mask = posix.sched_getaffinity(0)
|
||||
self.assertIsInstance(mask, set)
|
||||
self.assertGreaterEqual(len(mask), 1)
|
||||
self.assertRaises(OSError, posix.sched_getaffinity, -1)
|
||||
if not sys.platform.startswith("freebsd"):
|
||||
# bpo-47205: does not raise OSError on FreeBSD
|
||||
self.assertRaises(OSError, posix.sched_getaffinity, -1)
|
||||
for cpu in mask:
|
||||
self.assertIsInstance(cpu, int)
|
||||
self.assertGreaterEqual(cpu, 0)
|
||||
|
|
@ -1197,7 +1199,9 @@ def test_sched_setaffinity(self):
|
|||
self.assertRaises(ValueError, posix.sched_setaffinity, 0, [-10])
|
||||
self.assertRaises(ValueError, posix.sched_setaffinity, 0, map(int, "0X"))
|
||||
self.assertRaises(OverflowError, posix.sched_setaffinity, 0, [1<<128])
|
||||
self.assertRaises(OSError, posix.sched_setaffinity, -1, mask)
|
||||
if not sys.platform.startswith("freebsd"):
|
||||
# bpo-47205: does not raise OSError on FreeBSD
|
||||
self.assertRaises(OSError, posix.sched_setaffinity, -1, mask)
|
||||
|
||||
def test_rtld_constants(self):
|
||||
# check presence of major RTLD_* constants
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue