From b84e40ce16f74de7e430228fa1801795c0c7a6d0 Mon Sep 17 00:00:00 2001 From: Sean Breckenridge Date: Thu, 18 Mar 2021 03:22:33 -0700 Subject: [PATCH] my.core.serialize: bug; __type__ attr doesnt exist --- my/core/serialize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/my/core/serialize.py b/my/core/serialize.py index e368d67..003b316 100644 --- a/my/core/serialize.py +++ b/my/core/serialize.py @@ -32,7 +32,7 @@ def _default_encode(obj: Any) -> Any: # discussion: https://github.com/karlicoss/HPI/issues/138#issuecomment-801704929 if hasattr(obj, '_serialize') and callable(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'