From e16265d36797d2929e653a7d49b1a53accdbec59 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Wed, 4 Jan 2017 23:17:47 -0500 Subject: [PATCH] Issue #29162: Don't depend on 'from tkinter import *' importing sys. Fix error in format string. --- Lib/idlelib/pyshell.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index e1eade1eea1..f3ee391ca00 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