Skip to content

Commit 7b4d879

Browse files
committed
Fix Python 3.11 compatibility in api_import.py
Extract backslash-containing .replace() calls out of f-string expressions to fix SyntaxError on Python <3.12 where f-string expression parts cannot include backslashes. https://claude.ai/code/session_01VzBz78XPLwNAzDDaSFsTbC
1 parent 6e3e462 commit 7b4d879

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

local_nexus_controller/routers/api_import.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,9 +1033,11 @@ def github_localize_pr(req: GitHubLocalizePrRequest) -> dict:
10331033
if not str(svc.get("working_directory") or "").strip():
10341034
svc["working_directory"] = "{REPO_ROOT}"
10351035
if not str(svc.get("start_command") or "").strip():
1036-
svc["start_command"] = f"powershell -ExecutionPolicy Bypass -File {start_ps1_path.replace('/', '\\\\')}"
1036+
_start_win = start_ps1_path.replace('/', '\\')
1037+
svc["start_command"] = f"powershell -ExecutionPolicy Bypass -File {_start_win}"
10371038
if not str(svc.get("stop_command") or "").strip():
1038-
svc["stop_command"] = f"powershell -ExecutionPolicy Bypass -File {stop_ps1_path.replace('/', '\\\\')}"
1039+
_stop_win = stop_ps1_path.replace('/', '\\')
1040+
svc["stop_command"] = f"powershell -ExecutionPolicy Bypass -File {_stop_win}"
10391041

10401042
tech = svc.get("tech_stack")
10411043
if not isinstance(tech, list):

0 commit comments

Comments
 (0)