resolve paths

This commit is contained in:
Khaleel Al-Adhami 2024-11-19 13:38:31 -08:00
parent 25f9f74e24
commit 96f038de1a

View File

@ -812,9 +812,9 @@ def get_config(reload: bool = False) -> Config:
# only import the module if it exists. If a module spec exists then
# the module exists.
spec = find_spec(constants.Config.MODULE)
cwd = Path(os.getcwd())
cwd = Path(os.getcwd()).resolve()
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
# running unit/integration tests.