Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9abba71 commit 9dbfe2dCopy full SHA for 9dbfe2d
1 file changed
Lib/test/test_mmap.py
@@ -255,10 +255,15 @@ def test_access_parameter(self):
255
# Try writing with PROT_EXEC and without PROT_WRITE
256
prot = mmap.PROT_READ | getattr(mmap, 'PROT_EXEC', 0)
257
with open(TESTFN, "r+b") as f:
258
- m = mmap.mmap(f.fileno(), mapsize, prot=prot)
259
- self.assertRaises(TypeError, m.write, b"abcdef")
260
- self.assertRaises(TypeError, m.write_byte, 0)
261
- m.close()
+ try:
+ m = mmap.mmap(f.fileno(), mapsize, prot=prot)
+ except PermissionError:
+ # on macOS 14, PROT_READ | PROT_WRITE is not allowed
262
+ pass
263
+ else:
264
+ self.assertRaises(TypeError, m.write, b"abcdef")
265
+ self.assertRaises(TypeError, m.write_byte, 0)
266
+ m.close()
267
268
def test_bad_file_desc(self):
269
# Try opening a bad file descriptor...
0 commit comments