File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -241,10 +241,15 @@ def test_access_parameter(self):
241
241
# Try writing with PROT_EXEC and without PROT_WRITE
242
242
prot = mmap .PROT_READ | getattr (mmap , 'PROT_EXEC' , 0 )
243
243
with open (TESTFN , "r+b" ) as f :
244
- m = mmap .mmap (f .fileno (), mapsize , prot = prot )
245
- self .assertRaises (TypeError , m .write , b"abcdef" )
246
- self .assertRaises (TypeError , m .write_byte , 0 )
247
- m .close ()
244
+ try :
245
+ m = mmap .mmap (f .fileno (), mapsize , prot = prot )
246
+ except PermissionError :
247
+ # on macOS 14, PROT_READ | PROT_WRITE is not allowed
248
+ pass
249
+ else :
250
+ self .assertRaises (TypeError , m .write , b"abcdef" )
251
+ self .assertRaises (TypeError , m .write_byte , 0 )
252
+ m .close ()
248
253
249
254
def test_bad_file_desc (self ):
250
255
# Try opening a bad file descriptor...
You can’t perform that action at this time.
0 commit comments