bug fix and proper log

This commit is contained in:
geekan 2023-12-19 16:31:38 +08:00
parent d5d7db0bf8
commit 2c1538f350

View file

@ -266,11 +266,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):