fix(render): apply as_posix to fallback branch + hoist shutil import

This commit is contained in:
Trevin Chow
2026-05-17 00:19:49 -07:00
parent 5817ef8387
commit 0e353ae03f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -197,7 +197,7 @@ def compute_save_path_display(save_dir: str, topic: str, suffix: str, emit: str)
relative = raw.relative_to(home) relative = raw.relative_to(home)
return f"~/{relative.as_posix()}" return f"~/{relative.as_posix()}"
except ValueError: except ValueError:
return str(raw) return raw.as_posix()
def read_synthesis_file(path: str) -> str: def read_synthesis_file(path: str) -> str:
+1 -1
View File
@@ -1,6 +1,7 @@
# ruff: noqa: E402 # ruff: noqa: E402
import json import json
import io import io
import shutil
import tempfile import tempfile
import subprocess import subprocess
import sys import sys
@@ -150,7 +151,6 @@ class CliV3Tests(unittest.TestCase):
# f"~/{relative.as_posix()}" which forces forward slashes regardless # f"~/{relative.as_posix()}" which forces forward slashes regardless
# of host OS. On POSIX hosts this asserts the contract for # of host OS. On POSIX hosts this asserts the contract for
# cross-platform safety; on Windows hosts it would fail without the fix. # cross-platform safety; on Windows hosts it would fail without the fix.
import shutil
real_home = Path.home() real_home = Path.home()
tmp_under_home = Path(tempfile.mkdtemp(prefix="l30d_save_path_", dir=str(real_home))) tmp_under_home = Path(tempfile.mkdtemp(prefix="l30d_save_path_", dir=str(real_home)))
try: try: