[Python-checkins] cpython (3.5): Issue #25507: IDLE no longer runs buggy code because of its tkinter imports.
terry.reedy
python-checkins at python.org
Sat Jul 16 18:27:24 EDT 2016
https://hg.python.org/cpython/rev/8df5200064c4
changeset: 102372:8df5200064c4
branch: 3.5
parent: 102369:6b46c1510bfa
user: Terry Jan Reedy <tjreedy at udel.edu>
date: Sat Jul 16 18:26:32 2016 -0400
summary:
Issue #25507: IDLE no longer runs buggy code because of its tkinter imports.
Users must include the same imports required to run directly in Python.
files:
Lib/idlelib/run.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -19,6 +19,12 @@
import __main__
+for mod in ('simpledialog', 'messagebox', 'font',
+ 'dialog', 'filedialog', 'commondialog',
+ 'colorchooser'):
+ delattr(tkinter, mod)
+ del sys.modules['tkinter.' + mod]
+
LOCALHOST = '127.0.0.1'
import warnings
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list