[config] fix 'JSONDecodeError' when using non-JSON config types (#9063)
fixes regression introduced in 56f2790626
This commit is contained in:
@@ -73,6 +73,9 @@ def default(type=None):
|
|||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
|
default(os.environ.get("GDL_CONFIG_TYPE"))
|
||||||
|
|
||||||
|
|
||||||
def initialize():
|
def initialize():
|
||||||
paths = list(map(util.expand_path, _default_configs))
|
paths = list(map(util.expand_path, _default_configs))
|
||||||
|
|
||||||
@@ -211,8 +214,11 @@ def remap_categories():
|
|||||||
opts[new] = opts[old]
|
opts[new] = opts[old]
|
||||||
|
|
||||||
|
|
||||||
def load(files=None, strict=False, loads=_load, conf=_config):
|
def load(files=None, strict=False, loads=None, conf=_config):
|
||||||
"""Load JSON configuration files"""
|
"""Load configuration files"""
|
||||||
|
if loads is None:
|
||||||
|
loads = _load
|
||||||
|
|
||||||
for pathfmt in files or _default_configs:
|
for pathfmt in files or _default_configs:
|
||||||
path = util.expand_path(pathfmt)
|
path = util.expand_path(pathfmt)
|
||||||
try:
|
try:
|
||||||
@@ -374,6 +380,3 @@ class apply():
|
|||||||
unset(path, key)
|
unset(path, key)
|
||||||
else:
|
else:
|
||||||
set(path, key, value)
|
set(path, key, value)
|
||||||
|
|
||||||
|
|
||||||
default(os.environ.get("GDL_CONFIG_TYPE"))
|
|
||||||
|
|||||||
Reference in New Issue
Block a user