Skip to content

Commit 303f8b2

Browse files
committed
Don't expand when finding our entry to remove
1 parent 9ca0ebe commit 303f8b2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/manage/uninstall_command.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ def _do_purge_global_dir(global_dir, warn_msg, *, hive=None, subkey="Environment
3535
paths = path.split(";")
3636
newpaths = []
3737
for p in paths:
38-
ep = os.path.expandvars(p) if kind == winreg.REG_EXPAND_SZ else p
38+
# We should expand entries here, but we only want to remove those
39+
# that we added ourselves (during firstrun), and we never use
40+
# environment variables. So even if the kind is REG_EXPAND_SZ, we
41+
# don't need to expand to find our own entry.
42+
#ep = os.path.expandvars(p) if kind == winreg.REG_EXPAND_SZ else p
43+
ep = p
3944
if PurePath(ep).match(global_dir):
4045
LOGGER.debug("Removing from PATH: %s", p)
4146
else:

0 commit comments

Comments
 (0)