Skip to content

Commit

Permalink
bpo-34754: Fix test_flush_return_value on FreeBSD (GH-9451)
Browse files Browse the repository at this point in the history
Apparently, FreeBSD doesn't raise OSError when offset is
not a multiple of mmap.PAGESIZE.
  • Loading branch information
berkerpeksag authored Sep 20, 2018
1 parent e247b46 commit bc85475
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Lib/test/test_mmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,9 @@ def test_flush_return_value(self):
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'))


Expand Down

0 comments on commit bc85475

Please sign in to comment.