]> granicus.if.org Git - python/commitdiff
bpo-34754: Fix test_flush_return_value on FreeBSD (GH-9451)
authorBerker Peksag <berker.peksag@gmail.com>
Thu, 20 Sep 2018 16:53:06 +0000 (19:53 +0300)
committerGitHub <noreply@github.com>
Thu, 20 Sep 2018 16:53:06 +0000 (19:53 +0300)
Apparently, FreeBSD doesn't raise OSError when offset is
not a multiple of mmap.PAGESIZE.

Lib/test/test_mmap.py

index d513810b35be414332bebb5bbf591b7da74a2654..246fdf01f9cdea5fc5858379c8f32376288c5613 100644 (file)
@@ -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'))