Bug #1566602: correct failure of posixpath unittest when $HOME ends
with a slash.
This commit is contained in:
parent
fb25773862
commit
8d1e5bffc1
|
@ -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:]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue