Skip to content

Commit 1553801

Browse files
Copilotrchiodo
andcommitted
Use getattr for safe singleThread attribute access in on_continue_request
Most DAP clients omit the optional singleThread field entirely. Using getattr(arguments, 'singleThread', False) is more defensive than direct attribute access, guarding against any non-standard arguments objects. Co-authored-by: rchiodo <19672699+rchiodo@users.noreply.github.com>
1 parent 4061cd9 commit 1553801

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_process_net_command_json.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,9 @@ def on_continue_request(self, py_db, request):
564564
# unless singleThread is explicitly true (and the capability
565565
# supportsSingleThreadExecutionRequests is advertised). Only use the
566566
# specific threadId when singleThread is set; otherwise resume all.
567-
single_thread = arguments.singleThread
567+
# Use getattr with a default of False since most DAP clients omit this
568+
# optional field entirely.
569+
single_thread = getattr(arguments, "singleThread", False)
568570
if not single_thread or py_db.multi_threads_single_notification:
569571
thread_id = "*"
570572

0 commit comments

Comments
 (0)