Index: Lib/StringIO.py =================================================================== --- Lib/StringIO.py (revision 41468) +++ Lib/StringIO.py (working copy) @@ -72,8 +72,7 @@ method is called repeatedly. This method returns the next input line, or raises StopIteration when EOF is hit. """ - if self.closed: - raise StopIteration + _complain_ifclosed(self.closed) r = self.readline() if not r: raise StopIteration Index: Lib/test/test_StringIO.py =================================================================== --- Lib/test/test_StringIO.py (revision 41468) +++ Lib/test/test_StringIO.py (working copy) @@ -87,6 +87,8 @@ eq(line, self._line + '\n') i += 1 eq(i, 5) + self._fp.close() + self.assertRaises(ValueError, self._fp.next) class TestStringIO(TestGenericStringIO): MODULE = StringIO