bug fix and proper log

This commit is contained in:
geekan 2023-12-19 16:31:38 +08:00 committed by better629
parent 437abd1754
commit 9ca0d57a91

View file

@ -282,11 +282,11 @@ T = TypeVar("T", bound="BaseModel")
class BaseContext(BaseModel):
@staticmethod
@classmethod
@handle_exception
def loads(val: str, cls: Type[T]) -> Optional[T]:
m = json.loads(val)
return cls(**m)
def loads(cls: Type[T], val: str) -> Optional[T]:
i = json.loads(val)
return cls(**i)
class CodingContext(BaseContext):