bpo-36264: Don't honor POSIX HOME in os.path.expanduser on Windows (GH-12282)

This commit is contained in:
Anthony Sottile 2019-03-12 08:39:57 -07:00 committed by Steve Dower
parent 410aea1ebf
commit 25ec4a45dc
6 changed files with 17 additions and 14 deletions

View file

@ -299,9 +299,7 @@ def expanduser(path):
while i < n and path[i] not in _get_bothseps(path):
i += 1
if 'HOME' in os.environ:
userhome = os.environ['HOME']
elif 'USERPROFILE' in os.environ:
if 'USERPROFILE' in os.environ:
userhome = os.environ['USERPROFILE']
elif not 'HOMEPATH' in os.environ:
return path