Skip to content

Commit a29ff3d

Browse files
Fix shutil.which error message showing None instead of original path
The walrus operator reassigned cli_path to None before the f-string was evaluated, losing the original path value in the error message. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3487774 commit a29ff3d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

python/copilot/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,8 +1265,9 @@ async def _start_cli_server(self) -> None:
12651265

12661266
# Verify CLI exists
12671267
if not os.path.exists(cli_path):
1268+
original_path = cli_path
12681269
if (cli_path := shutil.which(cli_path)) is None:
1269-
raise RuntimeError(f"Copilot CLI not found at {cli_path}")
1270+
raise RuntimeError(f"Copilot CLI not found at {original_path}")
12701271

12711272
# Start with user-provided cli_args, then add SDK-managed args
12721273
args = list(cfg.cli_args) + [

0 commit comments

Comments
 (0)