Skip to content

Commit

Permalink
Fix test_posix if RWF_HIPRI is defined but not preadv2. (GH-13980)
Browse files Browse the repository at this point in the history
If preadv2 is not available, preadv will raise NotImplementedError.
(cherry picked from commit 44867bb)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
  • Loading branch information
miss-islington and benjaminp committed Jun 11, 2019
1 parent fad8904 commit 22e8a6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/test/test_posix.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@ 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 NotImplementedError:
self.skipTest("preadv2 not available")
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
Expand Down

0 comments on commit 22e8a6d

Please sign in to comment.