Set base_dir at the appropriate time
This commit is contained in:
parent
258b7a4719
commit
381e50dec6
1 changed files with 3 additions and 3 deletions
|
|
@ -208,6 +208,9 @@ class Config:
|
||||||
May raise: ConfigurationException
|
May raise: ConfigurationException
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if not "base_dir" in self.local_vars:
|
||||||
|
self.local_vars["base_dir"] = path.parent
|
||||||
|
|
||||||
try:
|
try:
|
||||||
safer_exec(read_file(path), self.local_vars)
|
safer_exec(read_file(path), self.local_vars)
|
||||||
except (ReadFileException, ExecuteException) as e:
|
except (ReadFileException, ExecuteException) as e:
|
||||||
|
|
@ -215,9 +218,6 @@ class Config:
|
||||||
logger.debug(error_msg)
|
logger.debug(error_msg)
|
||||||
raise ConfigurationException(error_msg)
|
raise ConfigurationException(error_msg)
|
||||||
else:
|
else:
|
||||||
if not "base_dir" in self.local_vars:
|
|
||||||
self.local_vars["base_dir"] = path.parent
|
|
||||||
|
|
||||||
logger.info(f"Loaded config from {style_path(path)}")
|
logger.info(f"Loaded config from {style_path(path)}")
|
||||||
|
|
||||||
def copy(self) -> "Config":
|
def copy(self) -> "Config":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue