Issue #20113: os.readv() and os.writev() now raise an OSError exception on

error instead of returning -1.
This commit is contained in:
Victor Stinner 2014-01-08 15:21:28 +01:00
parent 2bcbc14117
commit 57ddf78b6b
4 changed files with 36 additions and 10 deletions

View file

@ -1227,6 +1227,11 @@ class TestInvalidFD(unittest.TestCase):
def test_read(self):
self.check(os.read, 1)
@unittest.skipUnless(hasattr(os, 'readv'), 'test needs os.readv()')
def test_readv(self):
buf = bytearray(10)
self.check(os.readv, [buf])
@unittest.skipUnless(hasattr(os, 'tcsetpgrp'), 'test needs os.tcsetpgrp()')
def test_tcsetpgrpt(self):
self.check(os.tcsetpgrp, 0)
@ -1235,6 +1240,10 @@ class TestInvalidFD(unittest.TestCase):
def test_write(self):
self.check(os.write, b" ")
@unittest.skipUnless(hasattr(os, 'writev'), 'test needs os.writev()')
def test_writev(self):
self.check(os.writev, [b'abc'])
class LinkTests(unittest.TestCase):
def setUp(self):