[config] fix 'JSONDecodeError' when using non-JSON config types (#9063)

fixes regression introduced in 56f2790626
This commit is contained in:
Mike Fährmann
2026-02-14 14:55:13 +01:00
parent 98eb857794
commit cc52986811

View File

@@ -73,6 +73,9 @@ def default(type=None):
))
default(os.environ.get("GDL_CONFIG_TYPE"))
def initialize():
paths = list(map(util.expand_path, _default_configs))
@@ -211,8 +214,11 @@ def remap_categories():
opts[new] = opts[old]
def load(files=None, strict=False, loads=_load, conf=_config):
"""Load JSON configuration files"""
def load(files=None, strict=False, loads=None, conf=_config):
"""Load configuration files"""
if loads is None:
loads = _load
for pathfmt in files or _default_configs:
path = util.expand_path(pathfmt)
try:
@@ -374,6 +380,3 @@ class apply():
unset(path, key)
else:
set(path, key, value)
default(os.environ.get("GDL_CONFIG_TYPE"))