changeset: 97160:13a8782a775e branch: 3.4 parent: 97155:fe55a36a335b user: Terry Jan Reedy date: Thu Jul 30 21:16:16 2015 -0400 files: Lib/idlelib/PyShell.py description: Issue 24759: Gracefull exit Idle if ttk import fails. diff -r fe55a36a335b -r 13a8782a775e Lib/idlelib/PyShell.py --- a/Lib/idlelib/PyShell.py Fri Jul 31 08:59:02 2015 +1200 +++ b/Lib/idlelib/PyShell.py Thu Jul 30 21:16:16 2015 -0400 @@ -23,6 +23,16 @@ "Your Python may not be configured for Tk. **", file=sys.__stderr__) sys.exit(1) import tkinter.messagebox as tkMessageBox +try: + from tkinter 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