Refactor debugger command fetching,
@@ -1371,7 +1371,8 @@ class Tracer(Executor):
else:
assert isinstance(cmd, DebuggerCommand)
self._initialize_new_command()
- return cmd
+ self._current_command = cmd
+ return
def _initialize_new_command(self):
self._command_completion_handler = getattr(
@@ -1464,7 +1465,7 @@ class FastTracer(Tracer):
while not self._is_interesting_frame(frame):
frame = frame.f_back
self._report_current_state(frame)
- self._current_command = self._fetch_next_debugger_command()
+ self._fetch_next_debugger_command()
def _should_skip_frame(self, frame, event):
if event == "call":
@@ -1516,14 +1517,14 @@ class FastTracer(Tracer):
self._register_affected_frame(arg[1], frame)
# UI doesn't know about separate exception events
self._report_current_state(frame)
- self._current_command = self._fetch_next_debugger_command()
+ self._fetch_next_debugger_command()
elif event == "line":
self._fresh_exception = None
if self._command_completion_handler(frame):
self._report_current_state(frame)
- self._current_command = self._fetch_next_debugger_command()
+ self._fetch_next_debugger_command()
else:
self._fresh_exception = None
@@ -1613,7 +1614,7 @@ class NiceTracer(Tracer):
def _breakpointhook(self, *args, **kw):
self._report_state(len(self._saved_states) - 1)
- self._current_command = self._fetch_next_debugger_command()
+ self._fetch_next_debugger_command()
def _install_marker_functions(self):
# Make dummy marker functions universally available by putting them
@@ -1912,7 +1913,7 @@ class NiceTracer(Tracer):
if cmd_complete:
state["in_client_log"] = True
self._report_state(self._current_state_index)
- self._current_command = self._fetch_next_debugger_command()
+ self._fetch_next_debugger_command()
if self._current_command.name == "step_back":
if self._current_state_index == 0:
