From: Terry Jan Reedy Date: Fri, 31 Jul 2015 01:16:09 +0000 (-0400) Subject: Issue 24759: Gracefull exit Idle if ttk import fails. X-Git-Tag: v2.7.11rc1~212 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a872fec1ec24b5131920151cd6c4bbcb836bf92d;p=thirdparty%2FPython%2Fcpython.git Issue 24759: Gracefull exit Idle if ttk import fails. --- diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index eec59789eee6..578d2bd87c42 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