aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/idlelib/pyshell.py
diff options
context:
space:
mode:
authorZhikang Yan <2951256653@qq.com>2025-05-03 01:03:32 +0800
committerGitHub <noreply@github.com>2025-05-02 20:03:32 +0300
commit7e7e49be78e26d0a3b861a04bbec1635aabb71b9 (patch)
tree5af5de29b525d162a9d1deaaa8dd3760d9589955 /Lib/idlelib/pyshell.py
parenta512905e156bc09a20b171686ac129e66c13f26a (diff)
downloadcpython-7e7e49be78e26d0a3b861a04bbec1635aabb71b9.tar.gz
cpython-7e7e49be78e26d0a3b861a04bbec1635aabb71b9.zip
gh-112936: Fix IDLE: no Shell menu item in single-process mode (GH-126598)
Diffstat (limited to 'Lib/idlelib/pyshell.py')
-rwxr-xr-xLib/idlelib/pyshell.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py
index 295d06e4a5f..60b63d58cdd 100755
--- a/Lib/idlelib/pyshell.py
+++ b/Lib/idlelib/pyshell.py
@@ -877,10 +877,9 @@ class PyShell(OutputWindow):
from idlelib.sidebar import ShellSidebar
def __init__(self, flist=None):
- if use_subprocess:
- ms = self.menu_specs
- if ms[2][0] != "shell":
- ms.insert(2, ("shell", "She_ll"))
+ ms = self.menu_specs
+ if ms[2][0] != "shell":
+ ms.insert(2, ("shell", "She_ll"))
self.interp = ModifiedInterpreter(self)
if flist is None:
root = Tk()
@@ -954,6 +953,11 @@ class PyShell(OutputWindow):
self.text.insert = self.per.top.insert
self.per.insertfilter(UserInputTaggingDelegator())
+ if not use_subprocess:
+ # Menu options "View Last Restart" and "Restart Shell" are disabled
+ self.update_menu_state("shell", 0, "disabled")
+ self.update_menu_state("shell", 1, "disabled")
+
def ResetFont(self):
super().ResetFont()