mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
bpo-33660: Fix PosixPath to resolve a relative path on root
This commit is contained in:
parent
82e79480d6
commit
94ad6c674f
3 changed files with 15 additions and 1 deletions
|
@ -329,7 +329,10 @@ class _PosixFlavour(_Flavour):
|
|||
# parent dir
|
||||
path, _, _ = path.rpartition(sep)
|
||||
continue
|
||||
newpath = path + sep + name
|
||||
if path.endswith(sep):
|
||||
newpath = path + name
|
||||
else:
|
||||
newpath = path + sep + name
|
||||
if newpath in seen:
|
||||
# Already seen this path
|
||||
path = seen[newpath]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue