From: Terry Jan Reedy Date: Thu, 5 Jan 2017 04:17:47 +0000 (-0500) Subject: Issue #29162: Don't depend on 'from tkinter import *' importing sys. X-Git-Tag: v3.6.1rc1~209 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e16265d36797d2929e653a7d49b1a53accdbec59;p=python Issue #29162: Don't depend on 'from tkinter import *' importing sys. Fix error in format string. --- diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index e1eade1eea..f3ee391ca0 100755 --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -5,15 +5,15 @@ try: except ImportError: print("** IDLE can't import Tkinter.\n" "Your Python may not be configured for Tk. **", file=sys.__stderr__) - sys.exit(1) + raise SystemExit(1) import tkinter.messagebox as tkMessageBox if TkVersion < 8.5: root = Tk() # otherwise create root in main root.withdraw() 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) - sys.exit(1) + raise SystemExit(1) from code import InteractiveInterpreter import getopt