[Python-checkins] bpo-38598: Do not try to compile IDLE shell or output windows (GH-16939)

Miss Skeleton (bot) webhook-mailer at python.org
Sat Oct 26 21:32:15 EDT 2019


https://github.com/python/cpython/commit/849b1b9f6c538085839f8059e0d6a5536d2fdb52
commit: 849b1b9f6c538085839f8059e0d6a5536d2fdb52
branch: 3.7
author: Miss Skeleton (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019年10月26日T18:32:11-07:00
summary:
bpo-38598: Do not try to compile IDLE shell or output windows (GH-16939)
(cherry picked from commit e3f90b217a5152275b180b466bd503658a734462)
Co-authored-by: Terry Jan Reedy <tjreedy at udel.edu>
files:
A Misc/NEWS.d/next/IDLE/2019-10-26-18-16-24.bpo-38598.6kH9FY.rst
M Lib/idlelib/runscript.py
diff --git a/Lib/idlelib/runscript.py b/Lib/idlelib/runscript.py
index e99d0d2e027fc..a54108794ab59 100644
--- a/Lib/idlelib/runscript.py
+++ b/Lib/idlelib/runscript.py
@@ -19,6 +19,7 @@
 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 @@ def __init__(self, editwin):
 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 @@ def _run_module_event(self, event, *, customize=False):
 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
index 0000000000000..5d04e4a79b622
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2019-10-26-18-16-24.bpo-38598.6kH9FY.rst
@@ -0,0 +1 @@
+Do not try to compile IDLE shell or output windows


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /