Merge pull request #3322 from volundmush/fix_base_option

Fixing output of BaseOption.display to always be str
This commit is contained in:
Griatch 2023-11-18 13:39:02 +01:00 committed by GitHub
commit dcc8546ce7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -170,7 +170,7 @@ class BaseOption:
""" """
return validatorfuncs.text(value, option_key=self.key, **kwargs) return validatorfuncs.text(value, option_key=self.key, **kwargs)
def display(self, **kwargs): def display(self, **kwargs) -> str:
""" """
Renders the Option's value as something pretty to look at. Renders the Option's value as something pretty to look at.
@ -183,7 +183,7 @@ class BaseOption:
timedelta is pretty ugly). timedelta is pretty ugly).
""" """
return self.value return self.value if isinstance(self.value, str) else str(self.value)
# Option classes # Option classes