Cosmetics
This commit is contained in:
parent
4c44940ec1
commit
e3a982dbce
@ -283,11 +283,10 @@ def load(paths: Optional[Iterable[Tuple[str, bool]]] = None
|
|||||||
config = {s: {o: parser[s][o] for o in parser.options(s)}
|
config = {s: {o: parser[s][o] for o in parser.options(s)}
|
||||||
for s in parser.sections()}
|
for s in parser.sections()}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if isinstance(e, FileNotFoundError) and ignore_if_missing:
|
if not ignore_if_missing or not isinstance(e, FileNotFoundError):
|
||||||
config = Configuration.SOURCE_MISSING
|
|
||||||
else:
|
|
||||||
raise RuntimeError("Failed to load %s: %s" % (config_source, e)
|
raise RuntimeError("Failed to load %s: %s" % (config_source, e)
|
||||||
) from e
|
) from e
|
||||||
|
config = Configuration.SOURCE_MISSING
|
||||||
configuration.update(config, config_source)
|
configuration.update(config, config_source)
|
||||||
return configuration
|
return configuration
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user