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 d8d876fCopy full SHA for d8d876f
pydantic_settings/sources.py
@@ -32,6 +32,7 @@
32
Optional,
33
Sequence,
34
Tuple,
35
+ Type,
36
TypeVar,
37
Union,
38
cast,
@@ -2115,7 +2116,7 @@ def read_env_file(
2115
2116
def _annotation_is_complex(annotation: type[Any] | None, metadata: list[Any]) -> bool:
2117
# If the model is a root model, the root annotation should be used to
2118
# evaluate the complexity.
- if isinstance(annotation, type) and issubclass(annotation, RootModel):
2119
+ if annotation is not None and inspect.isclass(annotation) and issubclass(annotation, RootModel):
2120
# In some rare cases (see test_root_model_as_field),
2121
# the root attribute is not available. For these cases, python 3.8 and 3.9
2122
# return 'RootModelRootType'.
0 commit comments