diff options
| author | Benjamin Peterson <benjamin@python.org> | 2011-05-26 09:56:41 -0500 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2011-05-26 09:56:41 -0500 |
| commit | 4fa68ab10bc6bcd6d0fcc422bb0807f6f9d56264 (patch) | |
| tree | ec50a2912791967170ff9f89d40e7d5dc86ad77a /Lib/StringIO.py | |
| parent | dbfba1667cce8a4e4b28a1cd1f8772e063c06e49 (diff) | |
| download | cpython-git-4fa68ab10bc6bcd6d0fcc422bb0807f6f9d56264.tar.gz | |
raise an ValueError in getvalue() on closed StringIO (closes #12161)
Thanks for Catalin Iacob for the patch.
Diffstat (limited to 'Lib/StringIO.py')
| -rw-r--r-- | Lib/StringIO.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/StringIO.py b/Lib/StringIO.py index 340fae1229..f74a066773 100644 --- a/Lib/StringIO.py +++ b/Lib/StringIO.py @@ -266,6 +266,7 @@ class StringIO: 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 = [] |
