Skip to content

Commit

Permalink
fix(cattrs): structure error as per latest version (#59)
Browse files Browse the repository at this point in the history
CattrsSerializer initialization breaks in cattrs latest versions (23.2.0) due to the error function moved/redefined to other file.

Co-authored-by: sunil <[email protected]>
  • Loading branch information
sahu-sunil and sunil authored Dec 1, 2023
1 parent b368618 commit 97dfda6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ def __init__(self):
# attempt to discover the version of structure_error to use.
if hasattr(self._cattrs_converter, "_structure_error"):
self._structure_error = self._cattrs_converter._structure_error
else:
elif hasattr(self._cattrs_converter, "_structure_default"):
self._structure_error = self._cattrs_converter._structure_default
else:
from cattrs.fns import raise_error

self._structure_error = raise_error

def can_handle(self, cls):
"""
Expand Down

0 comments on commit 97dfda6

Please sign in to comment.