resolve paths
This commit is contained in:
parent
25f9f74e24
commit
96f038de1a
@ -812,9 +812,9 @@ def get_config(reload: bool = False) -> Config:
|
|||||||
# only import the module if it exists. If a module spec exists then
|
# only import the module if it exists. If a module spec exists then
|
||||||
# the module exists.
|
# the module exists.
|
||||||
spec = find_spec(constants.Config.MODULE)
|
spec = find_spec(constants.Config.MODULE)
|
||||||
cwd = Path(os.getcwd())
|
cwd = Path(os.getcwd()).resolve()
|
||||||
if not spec or (
|
if not spec or (
|
||||||
spec.origin is not None and not Path(spec.origin).is_relative_to(cwd)
|
spec.origin is not None and not Path(spec.origin).resolve().is_relative_to(cwd)
|
||||||
):
|
):
|
||||||
# we need this condition to ensure that a ModuleNotFound error is not thrown when
|
# we need this condition to ensure that a ModuleNotFound error is not thrown when
|
||||||
# running unit/integration tests.
|
# running unit/integration tests.
|
||||||
|
Loading…
Reference in New Issue
Block a user