mirror of
https://github.com/python/cpython.git
synced 2025-09-25 01:43:11 +00:00
Fix posixpath.realpath() for multiple pardirs (fixes issue #6975).
This commit is contained in:
parent
fbc737eda1
commit
142d2bc3f1
2 changed files with 14 additions and 2 deletions
|
@ -382,9 +382,11 @@ def _joinrealpath(path, rest, seen):
|
|||
if name == pardir:
|
||||
# parent dir
|
||||
if path:
|
||||
path = dirname(path)
|
||||
path, name = split(path)
|
||||
if name == pardir:
|
||||
path = join(path, pardir, pardir)
|
||||
else:
|
||||
path = name
|
||||
path = pardir
|
||||
continue
|
||||
newpath = join(path, name)
|
||||
if not islink(newpath):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue