Skip to content

Commit

Permalink
Fix attribute error on Python 3.9 with typing.Sequence (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
hramezani authored Dec 13, 2024
1 parent 3667aed commit b8968a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pydantic_settings/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -1935,7 +1935,8 @@ def _metavar_format_recurse(self, obj: Any) -> str:
return self._metavar_format_choices([val.name for val in obj])
elif isinstance(obj, WithArgsTypes):
return self._metavar_format_choices(
list(map(self._metavar_format_recurse, self._get_modified_args(obj))), obj_qualname=obj.__qualname__
list(map(self._metavar_format_recurse, self._get_modified_args(obj))),
obj_qualname=obj.__qualname__ if hasattr(obj, '__qualname__') else str(obj),
)
elif obj is type(None):
return self.cli_parse_none_str
Expand Down

0 comments on commit b8968a7

Please sign in to comment.