]> granicus.if.org Git - python/commitdiff
Issue #25507: IDLE no longer runs buggy code because of its tkinter imports.
authorTerry Jan Reedy <tjreedy@udel.edu>
Sat, 16 Jul 2016 22:26:32 +0000 (18:26 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Sat, 16 Jul 2016 22:26:32 +0000 (18:26 -0400)
Users must include the same imports required to run directly in Python.

Lib/idlelib/run.py

index 595e7bc3aa1109d1f8bb280bfc2b3edea93ca159..28ce4200a92a534919ea5881fc1c8b5f510d81b1 100644 (file)
@@ -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