summaryrefslogtreecommitdiff
path: root/Lib/_pyio.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-10-31 02:28:07 +0200
committerGitHub <noreply@github.com>2018-10-31 02:28:07 +0200
commit0353b4eaaf451ad463ce7eb3074f6b62d332f401 (patch)
treeee6c8d6f8368ae88711440e187aaa7294f423f6c /Lib/_pyio.py
parent3f819ca138db6945ee4271bf13e42db9f9b3b1e4 (diff)
downloadcpython-git-0353b4eaaf451ad463ce7eb3074f6b62d332f401.tar.gz
bpo-33138: Change standard error message for non-pickleable and non-copyable types. (GH-6239)
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r--Lib/_pyio.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index b8975ff533..e4a879941e 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -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__,