diff options
author | Michael W. Hudson <mwh@python.net> | 2005-09-22 09:19:01 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2005-09-22 09:19:01 (GMT) |
commit | 10402a306f613b37c96b51771e7ad0e1cf60a3a4 (patch) | |
tree | 6c85e5c1a3d9cffc956aad4b7730ca86c88e008a /Lib | |
parent | 19e11c86a72f6da18bd07b822eabe2f38dd6d6c4 (diff) | |
download | cpython-10402a306f613b37c96b51771e7ad0e1cf60a3a4.zip cpython-10402a306f613b37c96b51771e7ad0e1cf60a3a4.tar.gz cpython-10402a306f613b37c96b51771e7ad0e1cf60a3a4.tar.bz2 |
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 e74a427..c61f7cc 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() |