Skip to content

Commit a73ec5a

Browse files
committed
[FIX] add datetime.time to JSONEncoder
1 parent 05476c0 commit a73ec5a

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
@@ -50,6 +50,8 @@ def default(self, obj): # pylint: disable=E0202,arguments-differ
5050
return obj.isoformat()
5151
elif isinstance(obj, datetime.date):
5252
return obj.isoformat()
53+
elif isinstance(obj, datetime.time):
54+
return obj.isoformat()
5355
elif isinstance(obj, decimal.Decimal):
5456
return float(obj)
5557
return super(JSONEncoder, self).default(obj)

0 commit comments

Comments
 (0)