mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Make cStringIO.truncate raise IOError for negative
arguments (even for -1). Fixes the last bit of #1359365.
This commit is contained in:
parent
283a1353a0
commit
cffcc8b195
3 changed files with 15 additions and 1 deletions
|
@ -62,6 +62,7 @@ class TestGenericStringIO(unittest.TestCase):
|
|||
eq(f.getvalue(), 'abcde')
|
||||
f.write('xyz')
|
||||
eq(f.getvalue(), 'abcdexyz')
|
||||
self.assertRaises(IOError, f.truncate, -1)
|
||||
f.close()
|
||||
self.assertRaises(ValueError, f.write, 'frobnitz')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue