summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mmap.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2018-09-20 16:53:06 (GMT)
committerGitHub <noreply@github.com>2018-09-20 16:53:06 (GMT)
commitbc854750589d4de0fd55693963964e0558b5c8ac (patch)
tree6748efb94dc27cbab1f66d3600211b9ee0be3b7e /Lib/test/test_mmap.py
parente247b46cba4f4d32ea96a15dbc36d73265171106 (diff)
downloadcpython-bc854750589d4de0fd55693963964e0558b5c8ac.zip
cpython-bc854750589d4de0fd55693963964e0558b5c8ac.tar.gz
cpython-bc854750589d4de0fd55693963964e0558b5c8ac.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_mmap.py')
-rw-r--r--Lib/test/test_mmap.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index d513810..246fdf0 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'))