agsconfigurator: fix stupid parse bool into string

This commit is contained in:
end-4
2025-04-07 21:02:33 +02:00
parent 15db586178
commit 699efba508
+3 -3
View File
@@ -8,9 +8,9 @@ import re
def parse_value(value): def parse_value(value):
"""Parse the value into its appropriate Python type (e.g., bool, int, float, list, dict, or string).""" """Parse the value into its appropriate Python type (e.g., bool, int, float, list, dict, or string)."""
try: try:
return ast.literal_eval(value) return json.loads(value)
except (ValueError, SyntaxError): except json.JSONDecodeError: # Fallback to string if parsing fails
return value # Fallback to string if parsing fails return value
def remove_trailing_commas(json_string): def remove_trailing_commas(json_string):
"""Remove trailing commas from JSON-like structures.""" """Remove trailing commas from JSON-like structures."""