rocm_mgr: easy fixes - simplify _get_venv to sys.prefix, _get_root to direct script_path import

This commit is contained in:
resonantsky
2026-04-02 21:13:22 +02:00
parent fdc2f46457
commit b659a06c60
+3 -7
View File
@@ -119,16 +119,12 @@ def _resolve_dtype() -> str:
# --- venv helpers ---
def _get_venv() -> str:
return os.environ.get("VIRTUAL_ENV", "") or sys.prefix
return sys.prefix
def _get_root() -> str:
"""App root — from modules.paths.script_path."""
try:
from modules.paths import script_path # pylint: disable=import-outside-toplevel
return str(script_path)
except Exception:
return str(Path(_get_venv()).parent)
from modules.paths import script_path # pylint: disable=import-outside-toplevel
return str(script_path)
def _expand_venv(value: str) -> str: