summaryrefslogtreecommitdiff
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-10-18 13:55:29 +0000
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-10-18 13:55:29 +0000
commit50f7d7e21346875886d0b86c50ff46adb7049b6b (patch)
tree2063a0d1532b4b11b60ac36514b9e77b24dc5481 /Lib/posixpath.py
parent0491047580e18f06727146fcdfc6b46c83ef537e (diff)
downloadcpython-git-50f7d7e21346875886d0b86c50ff46adb7049b6b.tar.gz
Issue #5117: Fixed root directory related issue on posixpath.relpath() and
ntpath.relpath().
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 81f25b86e0..aae38d5abf 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -403,8 +403,8 @@ def relpath(path, start=curdir):
if not path:
raise ValueError("no path specified")
- start_list = abspath(start).split(sep)
- path_list = abspath(path).split(sep)
+ start_list = [x for x in abspath(start).split(sep) if x]
+ path_list = [x for x in abspath(path).split(sep) if x]
# Work out how much of the filepath is shared by start and path.
i = len(commonprefix([start_list, path_list]))