(Merge 3.3) 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:26:12 +01:00
commit 149e540adf
4 changed files with 36 additions and 10 deletions

View file

@ -1267,6 +1267,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)
@ -1275,6 +1280,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):