From e77b65ffd54d0c3f2901a33ea5e20afbac9ac8d6 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 28 Nov 2025 13:17:50 +0100 Subject: [PATCH] fix: disabled choices must not generate error when loaded from .rougailcli.yml --- src/rougail/user_datas.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/rougail/user_datas.py b/src/rougail/user_datas.py index 411a3b840..52813aead 100644 --- a/src/rougail/user_datas.py +++ b/src/rougail/user_datas.py @@ -468,11 +468,14 @@ def convert_value(option, value, needs_convert): except: return value if option_type == "choice": - choices = option.value.list() - if value not in choices and isinstance(value, str): - # FIXME add other tests (boolean, float, ...) - if value.isnumeric() and int(value) in choices: - value = int(value) + try: + choices = option.value.list() + if value not in choices and isinstance(value, str): + # FIXME add other tests (boolean, float, ...) + if value.isnumeric() and int(value) in choices: + value = int(value) + except: + pass func = CONVERT_OPTION.get(option_type, {}).get("func") if func: try: