[Python-checkins] cpython (merge 3.3 -> default): (Merge 3.3) Issue #20113: Fix test_posix on OpenIndiana

victor.stinner python-checkins at python.org
Wed Jan 8 16:01:55 CET 2014


http://hg.python.org/cpython/rev/f1f707dd7cae
changeset: 88357:f1f707dd7cae
parent: 88355:cd50efdce294
parent: 88356:1993a8ec3f19
user: Victor Stinner <victor.stinner at gmail.com>
date: Wed Jan 08 16:01:42 2014 +0100
summary:
 (Merge 3.3) Issue #20113: Fix test_posix on OpenIndiana
files:
 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
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -290,7 +290,14 @@
 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 @@
 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)
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /