fix: serialize function objects to their repr

This commit is contained in:
Ankush Menat 2022-09-11 16:19:52 +05:30
parent 7a3c3910fe
commit 6d264b149a

View file

@ -182,6 +182,9 @@ def json_handler(obj):
elif type(obj) == type or isinstance(obj, Exception):
return repr(obj)
elif callable(obj):
return repr(obj)
else:
raise TypeError(
f"""Object of type {type(obj)} with value of {repr(obj)} is not JSON serializable"""