fix: serialize function objects to their repr
This commit is contained in:
parent
7a3c3910fe
commit
6d264b149a
1 changed files with 3 additions and 0 deletions
|
|
@ -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"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue