mirror of
https://github.com/rjNemo/fastapi
synced 2026-06-10 20:46:51 +00:00
♻ Move internal variable for errors in jsonable_encoder to put related code closer (#4560)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
parent
c8124496fc
commit
a64387c3fc
1 changed files with 1 additions and 1 deletions
|
|
@ -137,10 +137,10 @@ def jsonable_encoder(
|
||||||
if isinstance(obj, classes_tuple):
|
if isinstance(obj, classes_tuple):
|
||||||
return encoder(obj)
|
return encoder(obj)
|
||||||
|
|
||||||
errors: List[Exception] = []
|
|
||||||
try:
|
try:
|
||||||
data = dict(obj)
|
data = dict(obj)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
errors: List[Exception] = []
|
||||||
errors.append(e)
|
errors.append(e)
|
||||||
try:
|
try:
|
||||||
data = vars(obj)
|
data = vars(obj)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue