Skip to content

Commit 873e586

Browse files
committed
Fix
1 parent 3feba4a commit 873e586

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

src/cattrs/preconf/cbor2.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@
77
from cbor2 import dumps, loads
88

99
from ..converters import BaseConverter, Converter
10+
from ..fns import identity
1011
from ..literals import is_literal_containing_enums
1112
from ..strategies import configure_union_passthrough
12-
from . import (
13-
is_primitive_enum,
14-
literals_with_enums_unstructure_factory,
15-
primitive_enum_unstructure_factory,
16-
wrap,
17-
)
13+
from . import is_primitive_enum, literals_with_enums_unstructure_factory, wrap
1814

1915
T = TypeVar("T")
2016

@@ -41,9 +37,7 @@ def configure_converter(converter: BaseConverter):
4137
)
4238
converter.register_unstructure_hook(date, lambda v: v.isoformat())
4339
converter.register_structure_hook(date, lambda v, _: date.fromisoformat(v))
44-
converter.register_unstructure_hook_factory(
45-
is_primitive_enum, primitive_enum_unstructure_factory
46-
)
40+
converter.register_unstructure_hook_factory(is_primitive_enum, identity)
4741
converter.register_unstructure_hook_factory(
4842
is_literal_containing_enums, literals_with_enums_unstructure_factory
4943
)

0 commit comments

Comments
 (0)