mirror of
https://github.com/python/cpython.git
synced 2024-11-27 11:55:13 +08:00
Issue 24759: Gracefull exit Idle if ttk import fails.
This commit is contained in:
parent
5ccc18f298
commit
062759f1dc
@ -23,6 +23,16 @@ except ImportError:
|
||||
"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
|
||||
|
Loading…
Reference in New Issue
Block a user