Remove redundant dict allocation

This commit is contained in:
Kamil Monicz 2024-03-07 13:26:26 +01:00
parent 23d036b2d5
commit 3360cc7c69
No known key found for this signature in database
GPG Key ID: F9FB19F1C1DC9C23
1 changed files with 1 additions and 1 deletions

View File

@ -216,7 +216,7 @@ def jsonable_encoder(
exclude = set(exclude)
if isinstance(obj, BaseModel):
# TODO: remove when deprecating Pydantic v1
encoders: Dict[Any, Any] = {}
encoders = None
if not PYDANTIC_V2:
encoders = getattr(obj.__config__, "json_encoders", {}) # type: ignore[attr-defined]
if custom_encoder is not None: