Ensure path for finding root is absolute (#1550)

As Path.resolve() is buggy on windows (see https://bugs.python.org/issue38671)
an absolute path is ensured by prepending the Path.cwd()
This commit is contained in:
dhaug-op 2020-07-15 17:06:30 +02:00 committed by GitHub
parent 8d036ceb3f
commit 98ac69f04c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5834,7 +5834,7 @@ def find_project_root(srcs: Iterable[str]) -> Path:
if not srcs:
return Path("/").resolve()
path_srcs = [Path(src).resolve() for src in srcs]
path_srcs = [Path(Path.cwd(), src).resolve() for src in srcs]
# A list of lists of parents for each 'src'. 'src' is included as a
# "parent" of itself if it is a directory