Skip to content

Commit 2777bed

Browse files
fix: register encoder's doc incorrectly mentions TypeError (#384)
Since #358, custom encoders are expected to raise a ConvertError instead of a TypeError, but the docstring of register_encoder still mentions TypeError. Fix this to mention ConvertError instead.
1 parent e6e5d38 commit 2777bed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tomlkit/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def comment(string: str) -> Comment:
298298
def register_encoder(encoder: E) -> E:
299299
"""Add a custom encoder, which should be a function that will be called
300300
if the value can't otherwise be converted. It should takes a single value
301-
and return a TOMLKit item or raise a ``TypeError``.
301+
and return a TOMLKit item or raise a ``ConvertError``.
302302
"""
303303
CUSTOM_ENCODERS.append(encoder)
304304
return encoder

0 commit comments

Comments
 (0)