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):
240240 # Try writing with PROT_EXEC and without PROT_WRITE
241241 prot = mmap .PROT_READ | getattr (mmap , 'PROT_EXEC' , 0 )
242242 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 ()
247252
248253 def test_bad_file_desc (self ):
249254 # Try opening a bad file descriptor...
You can’t perform that action at this time.
0 commit comments