Skip to content

Commit 3eff625

Browse files
authored
Fix TypeError introduced in 2.5 (#392)
1 parent 7353e5b commit 3eff625

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pydantic_settings/sources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2115,7 +2115,7 @@ def read_env_file(
21152115
def _annotation_is_complex(annotation: type[Any] | None, metadata: list[Any]) -> bool:
21162116
# If the model is a root model, the root annotation should be used to
21172117
# evaluate the complexity.
2118-
if isinstance(annotation, type) and issubclass(annotation, RootModel):
2118+
if annotation is not None and inspect.isclass(annotation) and issubclass(annotation, RootModel):
21192119
# In some rare cases (see test_root_model_as_field),
21202120
# the root attribute is not available. For these cases, python 3.8 and 3.9
21212121
# return 'RootModelRootType'.

0 commit comments

Comments
 (0)