Skip to content

Commit e3a477a

Browse files
bpo-38598: Do not try to compile IDLE shell or output windows (GH-16939)
(cherry picked from commit e3f90b2) Co-authored-by: Terry Jan Reedy <[email protected]>
1 parent 11f0f11 commit e3a477a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Lib/idlelib/runscript.py

+7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from idlelib import macosx
2020
from idlelib import pyshell
2121
from idlelib.query import CustomRun
22+
from idlelib import outwin
2223

2324
indent_message = """Error: Inconsistent indentation detected!
2425
@@ -46,6 +47,9 @@ def __init__(self, editwin):
4647
self.editwin.text_frame.bind('<<run-module-event-2>>', self._run_module_event)
4748

4849
def check_module_event(self, event):
50+
if isinstance(self.editwin, outwin.OutputWindow):
51+
self.editwin.text.bell()
52+
return 'break'
4953
filename = self.getfilename()
5054
if not filename:
5155
return 'break'
@@ -129,6 +133,9 @@ def _run_module_event(self, event, *, customize=False):
129133
module being executed and also add that directory to its
130134
sys.path if not already included.
131135
"""
136+
if isinstance(self.editwin, outwin.OutputWindow):
137+
self.editwin.text.bell()
138+
return 'break'
132139
filename = self.getfilename()
133140
if not filename:
134141
return 'break'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Do not try to compile IDLE shell or output windows

0 commit comments

Comments
 (0)