https://github.com/python/cpython/commit/2f04bdab54abebc95b18c70665177e74eb0e0ce5
commit: 2f04bdab54abebc95b18c70665177e74eb0e0ce5
branch: main
author: Serhiy Storchaka <[email protected]>
committer: terryjreedy <[email protected]>
date: 2026-09-15T21:41:04-04:00
summary:

gh-69004: Disable the IDLE Debugger menu item while user code runs (#157599)

Like Stack Viewer since GH-17163, instead of a "Don't debug now" box.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

files:
A Misc/NEWS.d/next/IDLE/2026-09-15-23-27-38.gh-issue-69004.Z7Ym9G.rst
M Lib/idlelib/idle_test/test_mainmenu.py
M Lib/idlelib/pyshell.py

diff --git a/Lib/idlelib/idle_test/test_mainmenu.py 
b/Lib/idlelib/idle_test/test_mainmenu.py
index 51d2accfe48a1c..c884256a99eaaa 100644
--- a/Lib/idlelib/idle_test/test_mainmenu.py
+++ b/Lib/idlelib/idle_test/test_mainmenu.py
@@ -22,6 +22,7 @@ def test_tcl_indexes(self):
         # On failure, change pattern here and in function(s).
         # Patterns here have '.*' for re instead of '*' for tcl.
         for menu, pattern in (
+            ('debug', '.*ebugger'),  # PyShell.debug_menu_postcommand
             ('debug', '.*tack.*iewer'),  # PyShell.debug_menu_postcommand
             ('options', '.*ode.*ontext'),  # EW.__init__, CodeContext.toggle...
             ('options', '.*ine.*umbers'),  # EW.__init__, EW.toggle...event.
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py
index 6e57e306a3678d..51568d2a9e950e 100755
--- a/Lib/idlelib/pyshell.py
+++ b/Lib/idlelib/pyshell.py
@@ -1099,6 +1099,7 @@ def open_debugger(self):
 
     def debug_menu_postcommand(self):
         state = 'disabled' if self.executing else 'normal'
+        self.update_menu_state('debug', '*ebugger', state)
         self.update_menu_state('debug', '*tack*iewer', state)
 
     def beginexecuting(self):
diff --git 
a/Misc/NEWS.d/next/IDLE/2026-09-15-23-27-38.gh-issue-69004.Z7Ym9G.rst 
b/Misc/NEWS.d/next/IDLE/2026-09-15-23-27-38.gh-issue-69004.Z7Ym9G.rst
new file mode 100644
index 00000000000000..05d42efd451458
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2026-09-15-23-27-38.gh-issue-69004.Z7Ym9G.rst
@@ -0,0 +1,2 @@
+The Debugger item of the IDLE Debug menu is now disabled while user code
+runs, like Stack Viewer.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to