Skip to content

Commit b9ecc0f

Browse files
Fix test_posix if RWF_HIPRI is defined but not preadv2. (GH-13980)
If preadv2 is not available, preadv will raise NotImplementedError. (cherry picked from commit 44867bb) Co-authored-by: Benjamin Peterson <[email protected]>
1 parent 1c31d19 commit b9ecc0f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/test/test_posix.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ def test_preadv_flags(self):
310310
buf = [bytearray(i) for i in [5, 3, 2]]
311311
self.assertEqual(posix.preadv(fd, buf, 3, os.RWF_HIPRI), 10)
312312
self.assertEqual([b't1tt2', b't3t', b'5t'], list(buf))
313+
except NotImplementedError:
314+
self.skipTest("preadv2 not available")
313315
except OSError as inst:
314316
# Is possible that the macro RWF_HIPRI was defined at compilation time
315317
# but the option is not supported by the kernel or the runtime libc shared

0 commit comments

Comments
 (0)