Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d28aaa7

Browse files
Skip test_preadv_flags if RWF_HIPRI is not supported by the system (GH-12762)
(cherry picked from commit 46544f6) Co-authored-by: Pablo Galindo <[email protected]>
1 parent be63df2 commit d28aaa7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Lib/test/test_posix.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,14 @@ def test_preadv_flags(self):
308308
buf = [bytearray(i) for i in [5, 3, 2]]
309309
self.assertEqual(posix.preadv(fd, buf, 3, os.RWF_HIPRI), 10)
310310
self.assertEqual([b't1tt2', b't3t', b'5t'], list(buf))
311+
except OSError as inst:
312+
# Is possible that the macro RWF_HIPRI was defined at compilation time
313+
# but the option is not supported by the kernel or the runtime libc shared
314+
# library.
315+
if inst.errno in {errno.EINVAL, errno.ENOTSUP}:
316+
raise unittest.SkipTest("RWF_HIPRI is not supported by the current system")
317+
else:
318+
raise
311319
finally:
312320
os.close(fd)
313321

0 commit comments

Comments
 (0)