diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-01-08 15:01:42 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-01-08 15:01:42 (GMT) |
commit | 6f17deb9bb8d681c590b21166b39fc5f42d07cfc (patch) | |
tree | 9810450dfa0c2a2ee15d48fa3ca64d101d94f63f /Lib/test/test_posix.py | |
parent | 149e540adf47ccd57ac36afe265b7740a9dd74fc (diff) | |
parent | cd5ca6a564bedabd770389e4041755dc25e5de4a (diff) | |
download | cpython-6f17deb9bb8d681c590b21166b39fc5f42d07cfc.zip cpython-6f17deb9bb8d681c590b21166b39fc5f42d07cfc.tar.gz cpython-6f17deb9bb8d681c590b21166b39fc5f42d07cfc.tar.bz2 |
(Merge 3.3) Issue #20113: Fix test_posix on OpenIndiana
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r-- | Lib/test/test_posix.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index a9b3bdc..b1b8cd1 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) |