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 6d4a9e2..ee6d0f2 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -178,8 +178,8 @@ def samestat(s1, s2):
def ismount(path):
"""Test whether a path is a mount point"""
try:
- s1 = os.stat(path)
- s2 = os.stat(join(path, '..'))
+ s1 = os.lstat(path)
+ s2 = os.lstat(join(path, '..'))
except os.error:
return False # It doesn't exist -- so not a mount point :-)
dev1 = s1.st_dev
@@ -398,4 +398,6 @@ def relpath(path, start=curdir):
i = len(commonprefix([start_list, path_list]))
rel_list = [pardir] * (len(start_list)-i) + path_list[i:]
+ if not rel_list:
+ return curdir
return join(*rel_list)