[Python-checkins] cpython (merge 3.5 -> default): Issue #25507: Merge from 3.5 with ttk replacing colorchooser.

terry.reedy python-checkins at python.org
Sat Jul 16 18:27:24 EDT 2016


https://hg.python.org/cpython/rev/af602a891892
changeset:   102373:af602a891892
parent:      102371:49e1e8413ecc
parent:      102372:8df5200064c4
user:        Terry Jan Reedy <tjreedy at udel.edu>
date:        Sat Jul 16 18:27:11 2016 -0400
summary:
  Issue #25507: Merge from 3.5 with ttk replacing colorchooser.
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',
+            'ttk'):
+    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