From d0796ac350629f7c698f270825a9cfef31100be6 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Wed, 31 May 2023 11:04:35 -0500 Subject: [PATCH] fix: user proper site.addsitedir --- src/viv/viv.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/viv/viv.py b/src/viv/viv.py index 85e3a08..8174b9a 100755 --- a/src/viv/viv.py +++ b/src/viv/viv.py @@ -835,14 +835,8 @@ def use(*packages: str, track_exe: bool = False, name: str = "") -> Path: def modify_sys_path(new_path: Path) -> None: - # remove user-site - for i, path in enumerate(sys.path): - if path == site.USER_SITE: - sys.path.pop(i) - - sys.path.append( - str([p for p in (new_path / "lib").glob("python*/site-packages")][0]) - ) + sys.path = [p for p in sys.path if p is not site.USER_SITE] + site.addsitedir([*(new_path / "lib").glob("python*/site-packages")][0]) def get_venvs() -> Dict[str, ViVenv]: