Skip to content

Commit cf14fde

Browse files
let base class default method to raise typeerror
1 parent 1b3983b commit cf14fde

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mygeotab/serializers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def object_serializer(obj):
4848
if hasattr(obj, 'isoformat'):
4949
return dates.format_iso_datetime(obj)
5050
else:
51-
raise TypeError("Unserializable object {} of type {}".format(obj, type(obj)))
51+
# Let the base class default method raise the TypeError
52+
return json.JSONEncoder.default(obj)
5253

5354

5455
def object_deserializer(obj):

0 commit comments

Comments
 (0)