Skip to content

Commit 634798c

Browse files
committed
Make the CodecInfo picklable
1 parent 1c6ce4e commit 634798c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graalpython/lib-graalpython/_codecs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ class StreamWriter(TruffleCodec, codecs.StreamWriter):
119119
class StreamReader(TruffleCodec, codecs.StreamReader):
120120
pass
121121

122-
return codecs.CodecInfo(
122+
class TruffleCodecInfo(codecs.CodecInfo):
123+
def __reduce__(self):
124+
return __codec_info_for_truffle, (encoding,)
125+
126+
return TruffleCodecInfo(
123127
name=encoding,
124128
encode=TruffleCodec().encode,
125129
decode=TruffleCodec().decode,

0 commit comments

Comments
 (0)