Skip to content

Commit b551dfd

Browse files
committed
Updated dictionary and list sorting conditions
1 parent 431e477 commit b551dfd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/murfey/cli/generate_config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def construct_list(
118118
continue
119119
# Convert values if set
120120
try:
121-
eval_value = literal_eval(value)
121+
eval_value = literal_eval(value) if allow_eval else value
122122
except Exception:
123123
eval_value = value
124124
# Check if it's a permitted type (continue to allow None as value)
@@ -175,6 +175,7 @@ def construct_dict(
175175
allow_empty_value: bool = True,
176176
allow_eval: bool = True,
177177
sort_keys: bool = True,
178+
restrict_values_to_types: Optional[Type[Any] | tuple[Type[Any], ...]] = None,
178179
debug: bool = False,
179180
) -> dict[str, Any]:
180181
"""
@@ -219,7 +220,7 @@ def is_type(value: str, instance: Type[Any] | tuple[Type[Any], ...]) -> bool:
219220
continue
220221
# Convert values to numericals if set
221222
try:
222-
eval_value = literal_eval(value)
223+
eval_value = literal_eval(value) if allow_eval else value
223224
except Exception:
224225
eval_value = value
225226
dct[key] = eval_value

0 commit comments

Comments
 (0)