We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6e8595 commit 92dc2cbCopy full SHA for 92dc2cb
1 file changed
Src/StdLib/Lib/test/test_mmap.py
@@ -242,10 +242,15 @@ def test_access_parameter(self):
242
# Try writing with PROT_EXEC and without PROT_WRITE
243
prot = mmap.PROT_READ | getattr(mmap, 'PROT_EXEC', 0)
244
with open(TESTFN, "r+b") as f:
245
- m = mmap.mmap(f.fileno(), mapsize, prot=prot)
246
- self.assertRaises(TypeError, m.write, b"abcdef")
247
- self.assertRaises(TypeError, m.write_byte, 0)
248
- m.close()
+ try:
+ m = mmap.mmap(f.fileno(), mapsize, prot=prot)
+ except PermissionError:
+ # on macOS 14, PROT_READ | PROT_WRITE is not allowed
249
+ pass
250
+ else:
251
+ self.assertRaises(TypeError, m.write, b"abcdef")
252
+ self.assertRaises(TypeError, m.write_byte, 0)
253
+ m.close()
254
255
def test_bad_file_desc(self):
256
# Try opening a bad file descriptor...
0 commit comments