fix: avoid infinite loop in rougail

This commit is contained in:
egarette@silique.fr 2025-09-30 21:48:37 +02:00
parent 7fca8e9d62
commit b48328d021

View file

@ -107,6 +107,7 @@ class DynOptionDescription(OptionDescription):
parent: "SubConfig", parent: "SubConfig",
*, *,
uncalculated: bool = False, uncalculated: bool = False,
from_display_name: bool = False,
) -> List[str]: ) -> List[str]:
"""get dynamic identifiers""" """get dynamic identifiers"""
subconfig = parent.get_child( subconfig = parent.get_child(
@ -129,11 +130,15 @@ class DynOptionDescription(OptionDescription):
values = [] values = []
if __debug__: if __debug__:
if not isinstance(values, list): if not isinstance(values, list):
if not from_display_name:
name = self.impl_get_display_name(subconfig, with_quote=True)
else:
name = self.impl_getname()
raise ValueError( raise ValueError(
_( _(
"DynOptionDescription identifiers for option {0}, is not a list ({1})" "DynOptionDescription identifiers for option {0}, is not a list ({1})"
).format( ).format(
self.impl_get_display_name(subconfig, with_quote=True), values name, values
) )
) )
values_ = [] values_ = []