summaryrefslogtreecommitdiffstats
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 7e9dd85..bc76c90 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -417,9 +417,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):