File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -255,10 +255,15 @@ def test_access_parameter(self):
255
255
# Try writing with PROT_EXEC and without PROT_WRITE
256
256
prot = mmap .PROT_READ | getattr (mmap , 'PROT_EXEC' , 0 )
257
257
with open (TESTFN , "r+b" ) as f :
258
- m = mmap .mmap (f .fileno (), mapsize , prot = prot )
259
- self .assertRaises (TypeError , m .write , b"abcdef" )
260
- self .assertRaises (TypeError , m .write_byte , 0 )
261
- m .close ()
258
+ try :
259
+ m = mmap .mmap (f .fileno (), mapsize , prot = prot )
260
+ except PermissionError :
261
+ # on macOS 14, PROT_READ | PROT_WRITE is not allowed
262
+ pass
263
+ else :
264
+ self .assertRaises (TypeError , m .write , b"abcdef" )
265
+ self .assertRaises (TypeError , m .write_byte , 0 )
266
+ m .close ()
262
267
263
268
def test_bad_file_desc (self ):
<
3EB7
td data-grid-cell-id="diff-72134ea902824c38771f083192b3f7e3cee6d53476fee0fdc5c25b95421b7cdb-264-269-0" data-selected="false" role="gridcell" style="background-color:var(--bgColor-default);text-align:center" tabindex="-1" valign="top" class="focusable-grid-cell diff-line-number position-relative diff-line-number-neutral left-side">264
269
# Try opening a bad file descriptor...
You can’t perform that action at this time.
0 commit comments