mirror of
https://github.com/python/cpython.git
synced 2026-04-23 12:21:01 +00:00
Skip test_preadv_flags if RWF_HIPRI is not supported by the system (GH-12762)
(cherry picked from commit 46544f69bf)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
be63df287a
commit
d28aaa7df8
1 changed files with 8 additions and 0 deletions
|
|
@ -308,6 +308,14 @@ def test_preadv_flags(self):
|
|||
buf = [bytearray(i) for i in [5, 3, 2]]
|
||||
self.assertEqual(posix.preadv(fd, buf, 3, os.RWF_HIPRI), 10)
|
||||
self.assertEqual([b't1tt2', b't3t', b'5t'], list(buf))
|
||||
except OSError as inst:
|
||||
# Is possible that the macro RWF_HIPRI was defined at compilation time
|
||||
# but the option is not supported by the kernel or the runtime libc shared
|
||||
# library.
|
||||
if inst.errno in {errno.EINVAL, errno.ENOTSUP}:
|
||||
raise unittest.SkipTest("RWF_HIPRI is not supported by the current system")
|
||||
else:
|
||||
raise
|
||||
finally:
|
||||
os.close(fd)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue