Bug #1566602: correct failure of posixpath unittest when $HOME ends
with a slash. (backport from rev. 52065)
This commit is contained in:
parent
ad4e11e16d
commit
9c9a9ab634
|
@ -328,8 +328,7 @@ def expanduser(path):
|
|||
except KeyError:
|
||||
return path
|
||||
userhome = pwent.pw_dir
|
||||
if userhome.endswith('/'):
|
||||
i += 1
|
||||
userhome = userhome.rstrip('/')
|
||||
return userhome + path[i:]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue