summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2018-09-20 19:53:06 +0300
committerGitHub <noreply@github.com>2018-09-20 19:53:06 +0300
commitbc854750589d4de0fd55693963964e0558b5c8ac (patch)
tree6748efb94dc27cbab1f66d3600211b9ee0be3b7e
parente247b46cba4f4d32ea96a15dbc36d73265171106 (diff)
downloadcpython-git-bc854750589d4de0fd55693963964e0558b5c8ac.tar.gz
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.
-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 d513810b35..246fdf01f9 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'))