From a8a1fc470ba0ad479995609f7fb53ce1d677e27a Mon Sep 17 00:00:00 2001 From: Unrud Date: Wed, 15 Jan 2020 00:30:27 +0100 Subject: [PATCH] Allow boolean raw_value for boolean config entries --- radicale/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicale/config.py b/radicale/config.py index 1ebed20..1f4dd5b 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -355,7 +355,7 @@ class Configuration: "%s" % (option, section, source)) raw_value = config[section][option] try: - if type_ == bool: + if type_ == bool and type(raw_value) != bool: raw_value = _convert_to_bool(raw_value) new_values[section][option] = type_(raw_value) except Exception as e: @@ -363,7 +363,7 @@ class Configuration: "Invalid %s value for option %r in section %r in %s: " "%r" % (type_.__name__, option, section, source, raw_value)) from e - self._configs.append((config, source, internal)) + self._configs.append((config, source, bool(internal))) for section in new_values: if section not in self._values: self._values[section] = {}