summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-07-16 18:26:32 -0400
committerTerry Jan Reedy <tjreedy@udel.edu>2016-07-16 18:26:32 -0400
commita9ae1d67054fc0a8ad272082c41919044d1c1e9c (patch)
tree29d63cadc2caa1932132b7027b4dc6c720bbbbf1
parent3c5fbee8247bbc9a198192f46f1efd3043a48d67 (diff)
downloadcpython-a9ae1d67054fc0a8ad272082c41919044d1c1e9c.tar.gz
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.
-rw-r--r--Lib/idlelib/run.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index 595e7bc3aa..28ce4200a9 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -19,6 +19,12 @@ from idlelib import IOBinding
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