Skip to content

Commit 2e424ac

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 162a551 commit 2e424ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/copilot/client.py

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

12701270
# Verify CLI exists
12711271
if not os.path.exists(cli_path):
1272+
original_path = cli_path
12721273
if (cli_path := shutil.which(cli_path)) is None:
1273-
raise RuntimeError(f"Copilot CLI not found at {cli_path}")
1274+
raise RuntimeError(f"Copilot CLI not found at {original_path}")
12741275

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

0 commit comments

Comments
 (0)