mirror of https://github.com/vladmandic/automatic
rocm_mgr: easy fixes - simplify _get_venv to sys.prefix, _get_root to direct script_path import
parent
fdc2f46457
commit
b659a06c60
|
|
@ -119,16 +119,12 @@ def _resolve_dtype() -> str:
|
||||||
# --- venv helpers ---
|
# --- venv helpers ---
|
||||||
|
|
||||||
def _get_venv() -> str:
|
def _get_venv() -> str:
|
||||||
return os.environ.get("VIRTUAL_ENV", "") or sys.prefix
|
return sys.prefix
|
||||||
|
|
||||||
|
|
||||||
def _get_root() -> str:
|
def _get_root() -> str:
|
||||||
"""App root — from modules.paths.script_path."""
|
from modules.paths import script_path # pylint: disable=import-outside-toplevel
|
||||||
try:
|
return str(script_path)
|
||||||
from modules.paths import script_path # pylint: disable=import-outside-toplevel
|
|
||||||
return str(script_path)
|
|
||||||
except Exception:
|
|
||||||
return str(Path(_get_venv()).parent)
|
|
||||||
|
|
||||||
|
|
||||||
def _expand_venv(value: str) -> str:
|
def _expand_venv(value: str) -> str:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue