mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-63016: fix failing mmap.flush tests on FreeBSD (#143230)
Fix `mmap.flush` tests introduced in 1af21ea320
where some flag combinations are not supported on FreeBSD.
This commit is contained in:
parent
3ca1f2a370
commit
c3bfe5d5aa
1 changed files with 7 additions and 1 deletions
|
|
@ -1173,7 +1173,13 @@ def test_flush_parameters(self):
|
|||
if hasattr(mmap, 'MS_INVALIDATE'):
|
||||
m.flush(PAGESIZE * 2, flags=mmap.MS_INVALIDATE)
|
||||
if hasattr(mmap, 'MS_ASYNC') and hasattr(mmap, 'MS_INVALIDATE'):
|
||||
m.flush(0, PAGESIZE, flags=mmap.MS_ASYNC | mmap.MS_INVALIDATE)
|
||||
if sys.platform == 'freebsd':
|
||||
# FreeBSD doesn't support this combination
|
||||
with self.assertRaises(OSError) as cm:
|
||||
m.flush(0, PAGESIZE, flags=mmap.MS_ASYNC | mmap.MS_INVALIDATE)
|
||||
self.assertEqual(cm.exception.errno, errno.EINVAL)
|
||||
else:
|
||||
m.flush(0, PAGESIZE, flags=mmap.MS_ASYNC | mmap.MS_INVALIDATE)
|
||||
|
||||
@unittest.skipUnless(sys.platform == 'linux', 'Linux only')
|
||||
@support.requires_linux_version(5, 17, 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue