my.core.serialize: bug; __type__ attr doesnt exist
This commit is contained in:
parent
70b541280a
commit
b84e40ce16
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ def _default_encode(obj: Any) -> Any:
|
||||||
# discussion: https://github.com/karlicoss/HPI/issues/138#issuecomment-801704929
|
# discussion: https://github.com/karlicoss/HPI/issues/138#issuecomment-801704929
|
||||||
if hasattr(obj, '_serialize') and callable(obj._serialize):
|
if hasattr(obj, '_serialize') and callable(obj._serialize):
|
||||||
return obj._serialize()
|
return obj._serialize()
|
||||||
raise TypeError(f"Could not serialize object of type {obj.__type__.__name__}")
|
raise TypeError(f"Could not serialize object of type {type(obj).__name__}")
|
||||||
|
|
||||||
|
|
||||||
# could possibly run multiple times/raise warning if you provide different 'default'
|
# could possibly run multiple times/raise warning if you provide different 'default'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue