From 25ec4a45dcc36c8087f93bd1634b311613244fc6 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Tue, 12 Mar 2019 08:39:57 -0700 Subject: bpo-36264: Don't honor POSIX HOME in os.path.expanduser on Windows (GH-12282) --- Lib/ntpath.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Lib/ntpath.py') diff --git a/Lib/ntpath.py b/Lib/ntpath.py index 11bb297e16..b5e1d121fc 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -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 -- cgit v1.2.1