From e4d0b57f3c74bf36f447d404a423bb022db6493a Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 10 Jan 2021 02:59:57 +0000 Subject: [PATCH] Improve Minetest config parsing error messages --- app/tasks/minetestcheck/config.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/tasks/minetestcheck/config.py b/app/tasks/minetestcheck/config.py index c28bcbfc..b5d0d351 100644 --- a/app/tasks/minetestcheck/config.py +++ b/app/tasks/minetestcheck/config.py @@ -16,16 +16,13 @@ def parse_conf(string): key_value = line.split("=", 2) if len(key_value) < 2: - syntax_error("No value given") + syntax_error("Expected line to contain '='") key = key_value[0].strip() if key == "": - syntax_error("Empty key") + syntax_error("Missing key before '='") value = key_value[1].strip() - if value == "": - syntax_error("Empty value") - if value.startswith('"""'): value_lines = [] closed = False