https://github.com/python/cpython/commit/e2ad2c80425e9b0b673aabb83ed0a9d835cc7438 commit: e2ad2c80425e9b0b673aabb83ed0a9d835cc7438 branch: 3.13 author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com> committer: serhiy-storchaka <storch...@gmail.com> date: 2025-05-02T17:26:26Z summary:
[3.13] gh-112936: Fix IDLE: no Shell menu item in single-process mode (GH-126598) (GH-133310) (cherry picked from commit 7e7e49be78e26d0a3b861a04bbec1635aabb71b9) Co-authored-by: Zhikang Yan <2951256...@qq.com> files: A Misc/NEWS.d/next/IDLE/2024-11-08-18-07-13.gh-issue-112936.1Q2RcP.rst M Lib/idlelib/pyshell.py diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index 295d06e4a5f017..60b63d58cdd8a3 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 @@ def __init__(self, flist=None): 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() diff --git a/Misc/NEWS.d/next/IDLE/2024-11-08-18-07-13.gh-issue-112936.1Q2RcP.rst b/Misc/NEWS.d/next/IDLE/2024-11-08-18-07-13.gh-issue-112936.1Q2RcP.rst new file mode 100644 index 00000000000000..8536e38b54aa1b --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2024-11-08-18-07-13.gh-issue-112936.1Q2RcP.rst @@ -0,0 +1 @@ +fix IDLE: no Shell menu item in single-process mode. _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com