Skip to content

Commit fc4d93d

Browse files
gh-154260: Fix test_flush_parameters on DragonFly BSD (GH-154261)
DragonFly, like FreeBSD, rejects mmap.flush() with MS_ASYNC|MS_INVALIDATE (EINVAL). Use str.startswith() so the check also matches DragonFly, whose sys.platform carries a version suffix. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 4cde5cf commit fc4d93d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/test/test_mmap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,8 +1176,8 @@ def test_flush_parameters(self):
11761176
if hasattr(mmap, 'MS_INVALIDATE'):
11771177
m.flush(PAGESIZE * 2, flags=mmap.MS_INVALIDATE)
11781178
if hasattr(mmap, 'MS_ASYNC') and hasattr(mmap, 'MS_INVALIDATE'):
1179-
if sys.platform == 'freebsd':
1180-
# FreeBSD doesn't support this combination
1179+
if sys.platform.startswith(('freebsd', 'dragonfly')):
1180+
# FreeBSD and DragonFly don't support this combination
11811181
with self.assertRaises(OSError) as cm:
11821182
m.flush(0, PAGESIZE, flags=mmap.MS_ASYNC | mmap.MS_INVALIDATE)
11831183
self.assertEqual(cm.exception.errno, errno.EINVAL)

0 commit comments

Comments
 (0)