Unverified Commit 98ac69f0 authored by dhaug-op's avatar dhaug-op Committed by GitHub
Browse files

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()
parent 8d036ceb
Loading
Loading
Loading
Loading
+1 −1
Changes for src/black/__init__.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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