File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11"""Test program for the fcntl C module.
22"""
3+ import errno
34import multiprocessing
45import platform
56import os
@@ -135,16 +136,21 @@ def test_fcntl_bad_file_overflow(self):
135136 or platform .system () == "Android" ,
136137 "this platform returns EINVAL for F_NOTIFY DN_MULTISHOT" )
137138 def test_fcntl_64_bit (self ):
138- # Issue #1309352 : fcntl shouldn't fail when the third arg fits in a
139+ # Issue GH-42434 : fcntl shouldn't fail when the third arg fits in a
139140 # C 'long' but not in a C 'int'.
140141 try :
141142 cmd = fcntl .F_NOTIFY
142- # This flag is larger than 2**31 in 64-bit builds
143+ # DN_MULTISHOT is >= 2**31 in 64-bit builds
143144 flags = fcntl .DN_MULTISHOT
144145 except AttributeError :
145146 self .skipTest ("F_NOTIFY or DN_MULTISHOT unavailable" )
146147 fd = os .open (os .path .dirname (os .path .abspath (TESTFN )), os .O_RDONLY )
147148 try :
149+ try :
150+ fcntl .fcntl (fd , cmd , fcntl .DN_DELETE )
151+ except OSError as exc :
152+ if exc .errno == errno .EINVAL :
153+ self .skipTest ("F_NOTIFY not available by this environment" )
148154 fcntl .fcntl (fd , cmd , flags )
149155 finally :
150156 os .close (fd )
You can’t perform that action at this time.
0 commit comments