if hasattr(mmap, 'MS_INVALIDATE'):
m.flush(PAGESIZE * 2, flags=mmap.MS_INVALIDATE)
if hasattr(mmap, 'MS_ASYNC') and hasattr(mmap, 'MS_INVALIDATE'):
- if sys.platform == 'freebsd':
- # FreeBSD doesn't support this combination
+ if sys.platform.startswith(('freebsd', 'dragonfly')):
+ # FreeBSD and DragonFly don'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)