summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2015-07-31 01:16:09 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2015-07-31 01:16:09 (GMT)
commita872fec1ec24b5131920151cd6c4bbcb836bf92d (patch)
tree03d22ca1871636aaba868e07a7713288ac85e63a /Lib/idlelib
parentfa002d4cdd3a44a07252857ec7a55ed27fb15648 (diff)
downloadcpython-a872fec1ec24b5131920151cd6c4bbcb836bf92d.zip
cpython-a872fec1ec24b5131920151cd6c4bbcb836bf92d.tar.gz
cpython-a872fec1ec24b5131920151cd6c4bbcb836bf92d.tar.bz2
Issue 24759: Gracefull exit Idle if ttk import fails.
Diffstat (limited to 'Lib/idlelib')
-rwxr-xr-xLib/idlelib/PyShell.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index eec5978..578d2bd 100755
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -23,6 +23,16 @@ except ImportError:
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
sys.exit(1)
import tkMessageBox
+try:
+ import ttk
+except:
+ root = Tk()
+ root.withdraw()
+ tkMessageBox.showerror("Idle Cannot Start",
+ "Idle now requires the Tkinter ttk module from tcl/tk 8.5+.\n"
+ + "It found tk %s and no ttk." % TkVersion,
+ parent=root)
+ sys.exit(1)
from idlelib.EditorWindow import EditorWindow, fixwordbreaks
from idlelib.FileList import FileList