diff --git a/setuptools/config/expand.py b/setuptools/config/expand.py index 1497b20ca0..7a100d69c9 100644 --- a/setuptools/config/expand.py +++ b/setuptools/config/expand.py @@ -151,9 +151,7 @@ def _read_file(filepath: Union[bytes, _Path]) -> str: def _assert_local(filepath: _Path, root_dir: str): - # NOTE: Path.resolve() will raise RuntimeError if an infinite loop is - # encountered along the resolution path of root_dir or file_path. - if Path(root_dir).resolve() not in Path(filepath).resolve().parents: + if Path(os.path.abspath(root_dir)) not in Path(os.path.abspath(filepath)).parents: msg = f"Cannot access {filepath!r} (or anything outside {root_dir!r})" raise DistutilsOptionError(msg)