summaryrefslogtreecommitdiffstats
path: root/Lib/codecs.py
diff options
context:
space:
mode:
authorFurkan Onder <furkanonder@protonmail.com>2023-09-29 17:07:09 (GMT)
committerGitHub <noreply@github.com>2023-09-29 17:07:09 (GMT)
commit3439cb004943788d5e4698bfceec891e7118254c (patch)
treea6bdcd832442f155480f630f0a3562e147fc5c7c /Lib/codecs.py
parent7d57288f6d0e7fffb2002ceb460784d39277584a (diff)
downloadcpython-3439cb004943788d5e4698bfceec891e7118254c.zip
cpython-3439cb004943788d5e4698bfceec891e7118254c.tar.gz
cpython-3439cb004943788d5e4698bfceec891e7118254c.tar.bz2
gh-66143: Allow copying and pickling of CodecInfo object (GH-109235)
Co-authored-by: Robert Lehmann <mail@robertlehmann.de>
Diffstat (limited to 'Lib/codecs.py')
-rw-r--r--Lib/codecs.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/codecs.py b/Lib/codecs.py
index 82f2398..9b35b61 100644
--- a/Lib/codecs.py
+++ b/Lib/codecs.py
@@ -111,6 +111,9 @@ class CodecInfo(tuple):
(self.__class__.__module__, self.__class__.__qualname__,
self.name, id(self))
+ def __getnewargs__(self):
+ return tuple(self)
+
class Codec:
""" Defines the interface for stateless encoders/decoders.