mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-11-12 12:13:15 -06:00
fix: user proper site.addsitedir
This commit is contained in:
parent
e257b2a49b
commit
40aee738d1
1 changed files with 3 additions and 9 deletions
|
@ -51,7 +51,7 @@ from typing import (
|
|||
from urllib.error import HTTPError
|
||||
from urllib.request import urlopen
|
||||
|
||||
__version__ = "23.5a4-13-ga6bd81d-dev"
|
||||
__version__ = "23.5a4-14-ge257b2a-dev"
|
||||
|
||||
|
||||
class Config:
|
||||
|
@ -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]:
|
||||
|
|
Loading…
Reference in a new issue