mirror of
https://github.com/python/cpython.git
synced 2025-07-16 07:45:20 +00:00
(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:
commit
149e540adf
4 changed files with 36 additions and 10 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue