summaryrefslogtreecommitdiffstats
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-09-30 09:13:21 (GMT)
committerGeorg Brandl <georg@python.org>2006-09-30 09:13:21 (GMT)
commit8d1e5bffc1249cdb5a8ced25e6f89328e7366290 (patch)
tree81d831f699acb2bec8384512ec459df44cf2fbd1 /Lib/posixpath.py
parentfb25773862343f19d0b15209697f88122c11a63f (diff)
downloadcpython-8d1e5bffc1249cdb5a8ced25e6f89328e7366290.zip
cpython-8d1e5bffc1249cdb5a8ced25e6f89328e7366290.tar.gz
cpython-8d1e5bffc1249cdb5a8ced25e6f89328e7366290.tar.bz2
Bug #1566602: correct failure of posixpath unittest when $HOME ends
with a slash.
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 9dd0e90..07ab4b6 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -259,8 +259,7 @@ def expanduser(path):
except KeyError:
return path
userhome = pwent.pw_dir
- if userhome.endswith('/'):
- i += 1
+ userhome = userhome.rstrip('/')
return userhome + path[i:]