Skip to content

Commit 1478a48

Browse files
rchiodoCopilot
andcommitted
Fail fast on missing server listener for debug launch
Restore fail-fast behavior in spawn_debuggee: for a real debug launch, assert servers.listener is not None instead of silently skipping the port/adapterAccessToken setup, which would spawn a debuggee unable to connect back. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6d50fc5 commit 1478a48

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/debugpy/adapter/launchers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ def spawn_debuggee(
8989
env = {}
9090

9191
arguments = dict(start_request.arguments)
92-
if not session.no_debug and servers.listener is not None:
92+
if not session.no_debug:
93+
# For a debug launch the server listener must already be up; fail fast
94+
# rather than silently spawning a debuggee that can't connect back.
95+
assert servers.listener is not None
9396
_, arguments["port"] = sockets.get_address(servers.listener)
9497
arguments["adapterAccessToken"] = adapter.access_token
9598

0 commit comments

Comments
 (0)