mirror of
https://github.com/python/cpython.git
synced 2025-10-06 07:02:33 +00:00
bpo-33138: Change standard error message for non-pickleable and non-copyable types. (GH-6239)
This commit is contained in:
parent
3f819ca138
commit
0353b4eaaf
11 changed files with 17 additions and 91 deletions
|
@ -814,8 +814,7 @@ class _BufferedIOMixin(BufferedIOBase):
|
|||
return self.raw.mode
|
||||
|
||||
def __getstate__(self):
|
||||
raise TypeError("can not serialize a '{0}' object"
|
||||
.format(self.__class__.__name__))
|
||||
raise TypeError(f"cannot pickle {self.__class__.__name__!r} object")
|
||||
|
||||
def __repr__(self):
|
||||
modname = self.__class__.__module__
|
||||
|
@ -1554,7 +1553,7 @@ class FileIO(RawIOBase):
|
|||
self.close()
|
||||
|
||||
def __getstate__(self):
|
||||
raise TypeError("cannot serialize '%s' object", self.__class__.__name__)
|
||||
raise TypeError(f"cannot pickle {self.__class__.__name__!r} object")
|
||||
|
||||
def __repr__(self):
|
||||
class_name = '%s.%s' % (self.__class__.__module__,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue