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