Skip to content

Commit

Permalink
Ensure path for finding root is absolute (#1550)
Browse files Browse the repository at this point in the history
As Path.resolve() is buggy on windows (see https://bugs.python.org/issue38671)
an absolute path is ensured by prepending the Path.cwd()
  • Loading branch information
dquitmann-op authored Jul 15, 2020
1 parent 8d036ce commit 98ac69f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/black/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 98ac69f

Please sign in to comment.