fix: handle None values in valid_formats list generation

This commit is contained in:
Paul Gauthier (aider) 2024-11-26 07:02:34 -08:00
parent e648bac74b
commit 5d175745bf

View file

@ -166,7 +166,11 @@ class Coder:
res.original_kwargs = dict(kwargs)
return res
valid_formats = [c.edit_format for c in coders.__all__ if hasattr(c, "edit_format")]
valid_formats = [
str(c.edit_format)
for c in coders.__all__
if hasattr(c, "edit_format") and c.edit_format is not None
]
raise UnknownEditFormat(edit_format, valid_formats)
def clone(self, **kwargs):