diff options
author | Michael W. Hudson <mwh@python.net> | 2005-09-22 09:19:01 +0000 |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2005-09-22 09:19:01 +0000 |
commit | 446bbc399cbbd62a7bf7919bb8c82fd5b5e29150 (patch) | |
tree | 5f59f5b4be8e25c6ff5e3ab5d0d257f912e861fb /Lib | |
parent | 2371d4224b37cbc788edf6776ce4128ab0735e43 (diff) | |
download | cpython-446bbc399cbbd62a7bf7919bb8c82fd5b5e29150.tar.gz |
Patches #1298449 and #1298499: Add some missing checks for error
returns in cStringIO.c. Thanks to Andrew Bennetts.
This must be a backport candidate.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_StringIO.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_StringIO.py b/Lib/test/test_StringIO.py index e74a427af0..c61f7cc54a 100644 --- a/Lib/test/test_StringIO.py +++ b/Lib/test/test_StringIO.py @@ -44,6 +44,13 @@ class TestGenericStringIO(unittest.TestCase): f.seek(0) self.assertEqual(f.getvalue(), 'abc') + def test_writelines_error(self): + def errorGen(): + yield 'a' + raise KeyboardInterrupt() + f = self.MODULE.StringIO() + self.assertRaises(KeyboardInterrupt, f.writelines, errorGen()) + def test_truncate(self): eq = self.assertEqual f = self.MODULE.StringIO() |