diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-11-19 04:35:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-19 04:35:59 (GMT) |
commit | a62dcacc6e7fabc82c50dd942a838cd69d2846bd (patch) | |
tree | 8a34d658b6222527a992c75a74cd798366f22c84 /Lib/idlelib/pyshell.py | |
parent | 919be35eae2413dfb59b9517879f69fedec68b7e (diff) | |
download | cpython-a62dcacc6e7fabc82c50dd942a838cd69d2846bd.zip cpython-a62dcacc6e7fabc82c50dd942a838cd69d2846bd.tar.gz cpython-a62dcacc6e7fabc82c50dd942a838cd69d2846bd.tar.bz2 |
[3.12] gh-79871: IDLE - Fix and test debugger module (GH-11451) (#112256)
gh-79871: IDLE - Fix and test debugger module (GH-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%.
---------
(cherry picked from commit adedcfa06b553242d8033f6d9bebbcb3bc0dbb4d)
Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
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 |