commit | 4fa68ab10bc6bcd6d0fcc422bb0807f6f9d56264 | [log] [tgz] |
---|---|---|
author | Benjamin Peterson <benjamin@python.org> | Thu May 26 09:56:41 2011 -0500 |
committer | Benjamin Peterson <benjamin@python.org> | Thu May 26 09:56:41 2011 -0500 |
tree | ec50a2912791967170ff9f89d40e7d5dc86ad77a | |
parent | dbfba1667cce8a4e4b28a1cd1f8772e063c06e49 [diff] [blame] |
raise an ValueError in getvalue() on closed StringIO (closes #12161) Thanks for Catalin Iacob for the patch.
diff --git a/Lib/StringIO.py b/Lib/StringIO.py index 340fae1..f74a066 100644 --- a/Lib/StringIO.py +++ b/Lib/StringIO.py
@@ -266,6 +266,7 @@ 8th bit) will cause a UnicodeError to be raised when getvalue() is called. """ + _complain_ifclosed(self.closed) if self.buflist: self.buf += ''.join(self.buflist) self.buflist = []