Subtlety: ~root/a should expand to /a, not //a. Everything else unchanged.

This commit is contained in:
Guido van Rossum 1996-04-02 22:30:03 +00:00
parent ededb58c14
commit bbb4e10e91
1 changed files with 1 additions and 0 deletions

View File

@ -241,6 +241,7 @@ def expanduser(path):
except KeyError:
return path
userhome = pwent[5]
if userhome[-1:] == '/': i = i+1
return userhome + path[i:]