From bc854750589d4de0fd55693963964e0558b5c8ac Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Thu, 20 Sep 2018 19:53:06 +0300 Subject: [PATCH] bpo-34754: Fix test_flush_return_value on FreeBSD (GH-9451) Apparently, FreeBSD doesn't raise OSError when offset is not a multiple of mmap.PAGESIZE. --- Lib/test/test_mmap.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index d513810b35b..246fdf01f9c 100644 --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -749,8 +749,9 @@ class MmapTests(unittest.TestCase): mm.write(b'python') result = mm.flush() self.assertIsNone(result) - if os.name != 'nt': - # 'offset' must be a multiple of mmap.PAGESIZE. + if sys.platform.startswith('linux'): + # 'offset' must be a multiple of mmap.PAGESIZE on Linux. + # See bpo-34754 for details. self.assertRaises(OSError, mm.flush, 1, len(b'python'))