diff options
author | Zackery Spytz <zspytz@gmail.com> | 2021-01-28 23:13:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-28 23:13:22 (GMT) |
commit | 23a567c11ca36eedde0e119443c85cc16075deaf (patch) | |
tree | e0081288c0a71ed629d729107a820d1d7a0349bc /Lib/idlelib/editor.py | |
parent | 64fc105b2d2faaeadd1026d2417b83915af6622f (diff) | |
download | cpython-23a567c11ca36eedde0e119443c85cc16075deaf.zip cpython-23a567c11ca36eedde0e119443c85cc16075deaf.tar.gz cpython-23a567c11ca36eedde0e119443c85cc16075deaf.tar.bz2 |
bpo-23544: Disable IDLE Stack Viewer when running user code (GH-17163)
Starting stack viewer when user code is running, including when Debugger is active, hangs or crashes IDLE.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib/editor.py')
-rw-r--r-- | Lib/idlelib/editor.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py index 66e9da5..b9cb502 100644 --- a/Lib/idlelib/editor.py +++ b/Lib/idlelib/editor.py @@ -339,7 +339,7 @@ class EditorWindow: text.bind("<<toggle-code-context>>", self.code_context.toggle_code_context_event) else: - self.update_menu_state('options', '*Code Context', 'disabled') + self.update_menu_state('options', '*ode*ontext', 'disabled') if self.allow_line_numbers: self.line_numbers = self.LineNumbers(self) if idleConf.GetOption('main', 'EditorWindow', @@ -347,7 +347,7 @@ class EditorWindow: self.toggle_line_numbers_event() text.bind("<<toggle-line-numbers>>", self.toggle_line_numbers_event) else: - self.update_menu_state('options', '*Line Numbers', 'disabled') + self.update_menu_state('options', '*ine*umbers', 'disabled') def handle_winconfig(self, event=None): self.set_width() @@ -450,7 +450,9 @@ class EditorWindow: self.menudict = menudict = {} for name, label in self.menu_specs: underline, label = prepstr(label) - menudict[name] = menu = Menu(mbar, name=name, tearoff=0) + postcommand = getattr(self, f'{name}_menu_postcommand', None) + menudict[name] = menu = Menu(mbar, name=name, tearoff=0, + postcommand=postcommand) mbar.add_cascade(label=label, menu=menu, underline=underline) if macosx.isCarbonTk(): # Insert the application menu @@ -1527,7 +1529,7 @@ class EditorWindow: else: self.line_numbers.show_sidebar() menu_label = "Hide" - self.update_menu_label(menu='options', index='*Line Numbers', + self.update_menu_label(menu='options', index='*ine*umbers', label=f'{menu_label} Line Numbers') # "line.col" -> line, as an int |