This commit is contained in:
hashbro
2026-08-07 06:05:33 +08:00
parent 82f8a8fffe
commit db3a789c2e
3 changed files with 63 additions and 7 deletions
+15 -1
View File
@@ -87,6 +87,20 @@ def pick_channel(explicit: str | None, web_root: Path) -> str:
return channel
def resolve_python() -> str:
"""PHP/panel often launches `python3` such that sys.executable is ''."""
exe = (sys.executable or "").strip()
if exe:
return exe
for name in ("python3", "python"):
found = shutil.which(name)
if found:
return found
raise SystemExit(
"cannot locate python interpreter (sys.executable is empty; install python3 on PATH)"
)
def run(cmd: list[str]) -> None:
print("+", " ".join(cmd), flush=True)
subprocess.run(cmd, cwd=str(LAB_ROOT), check=True)
@@ -230,7 +244,7 @@ def main() -> int:
for item in fixed_rep:
domain_args += ["--reporting-domains", item]
py = sys.executable
py = resolve_python()
if same_domains:
dep = args.deployment_seed or prev_seeds.get("deployment_seed")