Skip to content

Commit

Permalink
Fix: Solve mypy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
nesitor committed Sep 25, 2024
1 parent ea48118 commit a611fb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/aleph/toolkit/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def dump(fp: IO, obj: Any) -> None:
raise NotImplementedError("orjson does not provide dump")


def dumps(obj: Any) -> SerializedJson:
def dumps(obj: Any) -> bytes:
try:
return orjson.dumps(obj)
except TypeError as e:
return bytes(json.dumps(obj))
return json.dumps(obj).encode()

0 comments on commit a611fb8

Please sign in to comment.