mirror of
https://github.com/python/cpython.git
synced 2025-09-18 22:50:26 +00:00
Issue #29162: Don't depend on 'from tkinter import *' importing sys.
Fix error in format string.
This commit is contained in:
parent
2a352b667b
commit
e16265d367
1 changed files with 3 additions and 3 deletions
|
@ -5,15 +5,15 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print("** IDLE can't import Tkinter.\n"
|
print("** IDLE can't import Tkinter.\n"
|
||||||
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
|
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
|
||||||
sys.exit(1)
|
raise SystemExit(1)
|
||||||
import tkinter.messagebox as tkMessageBox
|
import tkinter.messagebox as tkMessageBox
|
||||||
if TkVersion < 8.5:
|
if TkVersion < 8.5:
|
||||||
root = Tk() # otherwise create root in main
|
root = Tk() # otherwise create root in main
|
||||||
root.withdraw()
|
root.withdraw()
|
||||||
tkMessageBox.showerror("Idle Cannot Start",
|
tkMessageBox.showerror("Idle Cannot Start",
|
||||||
"Idle requires tcl/tk 8.5+, not $s." % TkVersion,
|
"Idle requires tcl/tk 8.5+, not %s." % TkVersion,
|
||||||
parent=root)
|
parent=root)
|
||||||
sys.exit(1)
|
raise SystemExit(1)
|
||||||
|
|
||||||
from code import InteractiveInterpreter
|
from code import InteractiveInterpreter
|
||||||
import getopt
|
import getopt
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue