From cd5ca6a564bedabd770389e4041755dc25e5de4a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 8 Jan 2014 16:01:31 +0100 Subject: Issue #20113: Fix test_posix on OpenIndiana --- Lib/test/test_posix.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 5e680c9..60806aa 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -290,7 +290,14 @@ class PosixTester(unittest.TestCase): self.assertEqual(b'test1tt2t3', posix.read(fd, 10)) # Issue #20113: empty list of buffers should not crash - self.assertEqual(posix.writev(fd, []), 0) + try: + size = posix.writev(fd, []) + except OSError: + # writev(fd, []) raises OSError(22, "Invalid argument") + # on OpenIndiana + pass + else: + self.assertEqual(size, 0) finally: os.close(fd) @@ -305,7 +312,14 @@ class PosixTester(unittest.TestCase): self.assertEqual([b'test1', b'tt2', b't3'], [bytes(i) for i in buf]) # Issue #20113: empty list of buffers should not crash - self.assertEqual(posix.readv(fd, []), 0) + try: + size = posix.readv(fd, []) + except OSError: + # readv(fd, []) raises OSError(22, "Invalid argument") + # on OpenIndiana + pass + else: + self.assertEqual(size, 0) finally: os.close(fd) -- cgit v0.12