Skip to content

Commit 9dfa93d

Browse files
author
Pavel Minaev
committed
.
1 parent ca33030 commit 9dfa93d

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

tests/debug/config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ def __setitem__(self, key, value):
125125
assert key in self.PROPERTIES
126126
self._dict[key] = value
127127

128+
def __repr__(self):
129+
return repr(dict(self))
130+
128131
def __getstate__(self):
129132
return dict(self)
130133

tests/debug/session.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ def __init__(self, debug_config=None):
133133
self.scratchpad = comms.ScratchPad(self)
134134
"""The ScratchPad object to talk to the debuggee."""
135135

136+
self.start_command = None
137+
"""Set to either "launch" or "attach" just before the corresponding request is sent.
138+
"""
139+
136140
self.start_request = None
137141
"""The "launch" or "attach" request that started executing code in this session.
138142
"""
@@ -494,8 +498,12 @@ def send_request(self, command, arguments=None, proceed=True):
494498
if self.timeline.is_frozen and proceed:
495499
self.proceed()
496500

501+
if command in ("launch", "attach"):
502+
self.start_command = command
503+
497504
message = self.channel.send_request(command, arguments)
498505
request = self.timeline.record_request(message)
506+
499507
if command in ("launch", "attach"):
500508
self.start_request = request
501509

@@ -539,10 +547,7 @@ def _process_event(self, event):
539547
sockets.remove(socket)
540548
assert not sockets, f"Unexpected sockets reported by adapter: {sockets}"
541549

542-
if (
543-
self.start_request is not None
544-
and self.start_request.command == "launch"
545-
):
550+
if self.start_command == "launch":
546551
if "launcher" in self.expected_adapter_sockets:
547552
# If adapter has just reported the launcher socket, it shouldn't be
548553
# reported thereafter.

0 commit comments

Comments
 (0)