Skip to content

Commit b8968a7

Browse files
authored
Fix attribute error on Python 3.9 with typing.Sequence (#497)
1 parent 3667aed commit b8968a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pydantic_settings/sources.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1935,7 +1935,8 @@ def _metavar_format_recurse(self, obj: Any) -> str:
19351935
return self._metavar_format_choices([val.name for val in obj])
19361936
elif isinstance(obj, WithArgsTypes):
19371937
return self._metavar_format_choices(
1938-
list(map(self._metavar_format_recurse, self._get_modified_args(obj))), obj_qualname=obj.__qualname__
1938+
list(map(self._metavar_format_recurse, self._get_modified_args(obj))),
1939+
obj_qualname=obj.__qualname__ if hasattr(obj, '__qualname__') else str(obj),
19391940
)
19401941
elif obj is type(None):
19411942
return self.cli_parse_none_str

0 commit comments

Comments
 (0)