mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
Subtlety: ~root/a should expand to /a, not //a. Everything else unchanged.
This commit is contained in:
parent
ededb58c14
commit
bbb4e10e91
1 changed files with 1 additions and 0 deletions
|
@ -241,6 +241,7 @@ def expanduser(path):
|
|||
except KeyError:
|
||||
return path
|
||||
userhome = pwent[5]
|
||||
if userhome[-1:] == '/': i = i+1
|
||||
return userhome + path[i:]
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue