We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7353e5b commit 3eff625Copy full SHA for 3eff625
pydantic_settings/sources.py
@@ -2115,7 +2115,7 @@ def read_env_file(
2115
def _annotation_is_complex(annotation: type[Any] | None, metadata: list[Any]) -> bool:
2116
# If the model is a root model, the root annotation should be used to
2117
# evaluate the complexity.
2118
- if isinstance(annotation, type) and issubclass(annotation, RootModel):
+ if annotation is not None and inspect.isclass(annotation) and issubclass(annotation, RootModel):
2119
# In some rare cases (see test_root_model_as_field),
2120
# the root attribute is not available. For these cases, python 3.8 and 3.9
2121
# return 'RootModelRootType'.
0 commit comments