diff options
author | Anthony Shaw <anthony.p.shaw@gmail.com> | 2023-11-19 04:20:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-19 04:20:38 (GMT) |
commit | adedcfa06b553242d8033f6d9bebbcb3bc0dbb4d (patch) | |
tree | 323d5c4a3d354d949826d2f46e0287248bd8ab18 /Lib/idlelib/pyshell.py | |
parent | 18c692946953e586db432fd06c856531a2b05127 (diff) | |
download | cpython-adedcfa06b553242d8033f6d9bebbcb3bc0dbb4d.zip cpython-adedcfa06b553242d8033f6d9bebbcb3bc0dbb4d.tar.gz cpython-adedcfa06b553242d8033f6d9bebbcb3bc0dbb4d.tar.bz2 |
gh-79871: IDLE - Fix and test debugger module (#11451)
Add docstrings to the debugger module. Fix two bugs: initialize Idb.botframe (should be in Bdb); In Idb.in_rpc_code, check whether prev_frame is None before trying to use it. Make other code changes.
Expand test_debugger coverage from 19% to 66%.
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib/pyshell.py')
-rwxr-xr-x | Lib/idlelib/pyshell.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index 7a27079..00b3732 100755 --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -133,8 +133,8 @@ class PyShellEditorWindow(EditorWindow): def __init__(self, *args): self.breakpoints = [] EditorWindow.__init__(self, *args) - self.text.bind("<<set-breakpoint-here>>", self.set_breakpoint_here) - self.text.bind("<<clear-breakpoint-here>>", self.clear_breakpoint_here) + self.text.bind("<<set-breakpoint>>", self.set_breakpoint_event) + self.text.bind("<<clear-breakpoint>>", self.clear_breakpoint_event) self.text.bind("<<open-python-shell>>", self.flist.open_shell) #TODO: don't read/write this from/to .idlerc when testing @@ -155,8 +155,8 @@ class PyShellEditorWindow(EditorWindow): ("Copy", "<<copy>>", "rmenu_check_copy"), ("Paste", "<<paste>>", "rmenu_check_paste"), (None, None, None), - ("Set Breakpoint", "<<set-breakpoint-here>>", None), - ("Clear Breakpoint", "<<clear-breakpoint-here>>", None) + ("Set Breakpoint", "<<set-breakpoint>>", None), + ("Clear Breakpoint", "<<clear-breakpoint>>", None) ] def color_breakpoint_text(self, color=True): @@ -181,11 +181,11 @@ class PyShellEditorWindow(EditorWindow): self.breakpoints.append(lineno) try: # update the subprocess debugger debug = self.flist.pyshell.interp.debugger - debug.set_breakpoint_here(filename, lineno) + debug.set_breakpoint(filename, lineno) except: # but debugger may not be active right now.... pass - def set_breakpoint_here(self, event=None): + def set_breakpoint_event(self, event=None): text = self.text filename = self.io.filename if not filename: @@ -194,7 +194,7 @@ class PyShellEditorWindow(EditorWindow): lineno = int(float(text.index("insert"))) self.set_breakpoint(lineno) - def clear_breakpoint_here(self, event=None): + def clear_breakpoint_event(self, event=None): text = self.text filename = self.io.filename if not filename: @@ -209,7 +209,7 @@ class PyShellEditorWindow(EditorWindow): "insert lineend +1char") try: debug = self.flist.pyshell.interp.debugger - debug.clear_breakpoint_here(filename, lineno) + debug.clear_breakpoint(filename, lineno) except: pass |