diff options
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r-- | Lib/_pyio.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py index b8975ff..e4a8799 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__, |