Reformatted code base using black.
This commit is contained in:
parent
56319cbad3
commit
53fdaa9d09
1 changed files with 12604 additions and 8966 deletions
|
|
@ -138,9 +138,7 @@ def serialise(data: Any) -> str:
|
|||
|
||||
|
||||
def deserialise(
|
||||
serialised_data: str,
|
||||
default: Any = None,
|
||||
type_check: type = dict
|
||||
serialised_data: str, default: Any = None, type_check: type = dict
|
||||
) -> Any:
|
||||
"""Deserialize data from bridge
|
||||
|
||||
|
|
@ -154,6 +152,9 @@ def deserialise(
|
|||
return default
|
||||
ret = json.loads(serialised_data)
|
||||
if type_check is not None and not isinstance(ret, type_check):
|
||||
raise ValueError("Bad data type, was expecting {type_check}, got {real_type}"
|
||||
.format(type_check=type_check, real_type=type(ret)))
|
||||
raise ValueError(
|
||||
"Bad data type, was expecting {type_check}, got {real_type}".format(
|
||||
type_check=type_check, real_type=type(ret)
|
||||
)
|
||||
)
|
||||
return ret
|
||||
|
|
|
|||
Loading…
Reference in a new issue