mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-117641: Improve the perfornance of posixpath.commonpath() (#117652)
This commit is contained in:
parent
6078f2033e
commit
b848b944bb
2 changed files with 2 additions and 1 deletions
|
@ -550,7 +550,7 @@ def commonpath(paths):
|
|||
split_paths = [path.split(sep) for path in paths]
|
||||
|
||||
try:
|
||||
isabs, = set(p[:1] == sep for p in paths)
|
||||
isabs, = {p.startswith(sep) for p in paths}
|
||||
except ValueError:
|
||||
raise ValueError("Can't mix absolute and relative paths") from None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue