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 @@ -242,10 +242,15 @@ def test_access_parameter(self):
242242 # Try writing with PROT_EXEC and without PROT_WRITE
243243 prot = mmap .PROT_READ | getattr (mmap , 'PROT_EXEC' , 0 )
244244 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 ()
245+ try :
246+ m = mmap .mmap (f .fileno (), mapsize , prot = prot )
247+ except PermissionError :
248+ # 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 ()
249254
250255 def test_bad_file_desc (self ):
251256 # Try opening a bad file descriptor...
You can’t perform that action at this time.
0 commit comments