]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38598: Do not try to compile IDLE shell or output windows (GH-16939)
authorMiss Skeleton (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 27 Oct 2019 01:32:11 +0000 (18:32 -0700)
committerGitHub <noreply@github.com>
Sun, 27 Oct 2019 01:32:11 +0000 (18:32 -0700)
(cherry picked from commit e3f90b217a5152275b180b466bd503658a734462)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Lib/idlelib/runscript.py
Misc/NEWS.d/next/IDLE/2019-10-26-18-16-24.bpo-38598.6kH9FY.rst [new file with mode: 0644]

index e99d0d2e027fc8db8e0c9d78502dda9563e45301..a54108794ab595d1353dce36d3658f496d773ec9 100644 (file)
@@ -19,6 +19,7 @@ from idlelib.config import idleConf
 from idlelib import macosx
 from idlelib import pyshell
 from idlelib.query import CustomRun
+from idlelib import outwin
 
 indent_message = """Error: Inconsistent indentation detected!
 
@@ -46,6 +47,9 @@ class ScriptBinding:
             self.editwin.text_frame.bind('<<run-module-event-2>>', self._run_module_event)
 
     def check_module_event(self, event):
+        if isinstance(self.editwin, outwin.OutputWindow):
+            self.editwin.text.bell()
+            return 'break'
         filename = self.getfilename()
         if not filename:
             return 'break'
@@ -129,6 +133,9 @@ class ScriptBinding:
         module being executed and also add that directory to its
         sys.path if not already included.
         """
+        if isinstance(self.editwin, outwin.OutputWindow):
+            self.editwin.text.bell()
+            return 'break'
         filename = self.getfilename()
         if not filename:
             return 'break'
diff --git a/Misc/NEWS.d/next/IDLE/2019-10-26-18-16-24.bpo-38598.6kH9FY.rst b/Misc/NEWS.d/next/IDLE/2019-10-26-18-16-24.bpo-38598.6kH9FY.rst
new file mode 100644 (file)
index 0000000..5d04e4a
--- /dev/null
@@ -0,0 +1 @@
+Do not try to compile IDLE shell or output windows