fixed config loading

This commit is contained in:
Devaev Maxim
2019-09-19 06:47:54 +03:00
parent 313e2c77fd
commit 300d4603ca
7 changed files with 44 additions and 49 deletions

View File

@@ -162,7 +162,7 @@ def make_config(raw: Dict[str, Any], scheme: Dict[str, Any], _keys: Tuple[str, .
value = raw.get(key, option.default)
try:
value = option.type(value)
except ValueError as err:
except (TypeError, ValueError) as err:
raise ConfigError(f"Invalid value {value!r} for key {make_full_name(key)!r}: {err}")
config[key] = value