Skip to content

Commit e16265d

Browse files
committed
Issue #29162: Don't depend on 'from tkinter import *' importing sys.
Fix error in format string.
1 parent 2a352b6 commit e16265d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/idlelib/pyshell.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
except ImportError:
66
print("** IDLE can't import Tkinter.\n"
77
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
8-
sys.exit(1)
8+
raise SystemExit(1)
99
import tkinter.messagebox as tkMessageBox
1010
if TkVersion < 8.5:
1111
root = Tk() # otherwise create root in main
1212
root.withdraw()
1313
tkMessageBox.showerror("Idle Cannot Start",
14-
"Idle requires tcl/tk 8.5+, not $s." % TkVersion,
14+
"Idle requires tcl/tk 8.5+, not %s." % TkVersion,
1515
parent=root)
16-
sys.exit(1)
16+
raise SystemExit(1)
1717

1818
from code import InteractiveInterpreter
1919
import getopt

0 commit comments

Comments
 (0)