Skip to content

Commit 5e3f549

Browse files
serllmignon
authored andcommitted
[FIX] add datetime.time to JSONEncoder
1 parent 09b1def commit 5e3f549

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

base_rest/http.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def default(self, obj): # pylint: disable=E0202,arguments-differ
5353
return obj.isoformat()
5454
elif isinstance(obj, datetime.date):
5555
return obj.isoformat()
56+
elif isinstance(obj, datetime.time):
57+
return obj.isoformat()
5658
elif isinstance(obj, decimal.Decimal):
5759
return float(obj)
5860
return super(JSONEncoder, self).default(obj)

0 commit comments

Comments
 (0)