my.core.serialize: formatting fixes
This commit is contained in:
parent
c3f3650bcc
commit
70b541280a
1 changed files with 0 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue