my.core.serialize: formatting fixes

This commit is contained in:
Sean Breckenridge 2021-03-18 03:12:50 -07:00
parent c3f3650bcc
commit 70b541280a

View file

@ -25,7 +25,6 @@ def _default_encode(obj: Any) -> Any:
return obj._asdict() return obj._asdict()
if isinstance(obj, datetime.timedelta): if isinstance(obj, datetime.timedelta):
return obj.total_seconds() return obj.total_seconds()
if isinstance(obj, Exception): if isinstance(obj, Exception):
return error_to_json(obj) return error_to_json(obj)
# note: _serialize would only be called for items which aren't already # note: _serialize would only be called for items which aren't already
@ -142,7 +141,6 @@ def test_default_serializer() -> None:
import pytest import pytest
import json as jsn # dont cause possible conflicts with module code import json as jsn # dont cause possible conflicts with module code
class Unserializable: class Unserializable:
def __init__(self, x: int): def __init__(self, x: int):
self.x = x self.x = x