Skip to content

Commit 65ced45

Browse files
fix codesmell
1 parent c049903 commit 65ced45

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/models-library/src/models_library/utils/json_serialization.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ def pydantic_encoder(obj: Any) -> Any:
105105
except KeyError:
106106
continue
107107
return encoder(obj)
108-
else: # We have exited the for loop without finding a suitable encoder
109-
raise TypeError(
110-
f"Object of type '{obj.__class__.__name__}' is not JSON serializable"
111-
)
108+
109+
# We have exited the for loop without finding a suitable encoder
110+
raise TypeError(
111+
f"Object of type '{obj.__class__.__name__}' is not JSON serializable"
112+
)
112113

113114

114115
def json_dumps(

0 commit comments

Comments
 (0)