mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +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:
|
except KeyError:
|
||||||
return path
|
return path
|
||||||
userhome = pwent[5]
|
userhome = pwent[5]
|
||||||
|
if userhome[-1:] == '/': i = i+1
|
||||||
return userhome + path[i:]
|
return userhome + path[i:]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue