Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7f7d5bf

Browse files
committed
Patch 543222. Disable script bindings in shell window.
1 parent f79f2f9 commit 7f7d5bf

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

Tools/idle/EditorWindow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class EditorWindow:
9595
about_text = about_text
9696

9797
vars = {}
98+
runnable = False # Shell window cannot Import Module or Run Script
9899

99100
def __init__(self, flist=None, filename=None, key=None, root=None):
100101
edconf = idleconf.getsection('EditorWindow')

Tools/idle/PyShell.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class PyShellEditorWindow(EditorWindow):
7676

7777
# Regular text edit window when a shell is present
7878
# XXX ought to merge with regular editor window
79+
runnable = True # Shell not present, enable Import Module and Run Script
7980

8081
def __init__(self, *args):
8182
apply(EditorWindow.__init__, (self,) + args)

Tools/idle/ScriptBinding.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ class ScriptBinding:
5151
]
5252

5353
def __init__(self, editwin):
54+
if not editwin.runnable:
55+
self.menudefs = []
56+
self.keydefs = {}
5457
self.editwin = editwin
5558
# Provide instance variables referenced by Debugger
5659
# XXX This should be done differently

0 commit comments

Comments
 (0)