mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Manual py3k backport: [svn r74158] Issue #6218: Make io.BytesIO and io.StringIO picklable.
This commit is contained in:
parent
fd42f30991
commit
fa94e80f3b
5 changed files with 415 additions and 18 deletions
|
@ -773,6 +773,11 @@ class BytesIO(BufferedIOBase):
|
|||
self._buffer = buf
|
||||
self._pos = 0
|
||||
|
||||
def __getstate__(self):
|
||||
if self.closed:
|
||||
raise ValueError("__getstate__ on closed file")
|
||||
return self.__dict__.copy()
|
||||
|
||||
def getvalue(self):
|
||||
"""Return the bytes value (contents) of the buffer
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue