diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2021-01-25 11:33:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-25 11:33:18 (GMT) |
commit | 879986d8a932c4524cb6ff822afc9537de16e28d (patch) | |
tree | 897aea5f98000a01fad09fa83303d3d5086ae61b /Lib/idlelib/pyshell.py | |
parent | cf19cc3b920ca5995e1c202d2c3dd7a59ac8eac8 (diff) | |
download | cpython-879986d8a932c4524cb6ff822afc9537de16e28d.zip cpython-879986d8a932c4524cb6ff822afc9537de16e28d.tar.gz cpython-879986d8a932c4524cb6ff822afc9537de16e28d.tar.bz2 |
bpo-43013: Fix old tkinter module names in idlelib (GH-24326)
Lowercase 'tkColorChooser', 'tkFileDialog', 'tkSimpleDialog', and
'tkMessageBox' and remove 'tk'. Just lowercase 'tkFont' as 'font'
is already used. Adjust import.
Diffstat (limited to 'Lib/idlelib/pyshell.py')
-rwxr-xr-x | Lib/idlelib/pyshell.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index abe8a85..0407ca9 100755 --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -21,13 +21,13 @@ if sys.platform == 'win32': except (ImportError, AttributeError, OSError): pass -import tkinter.messagebox as tkMessageBox +from tkinter import messagebox if TkVersion < 8.5: root = Tk() # otherwise create root in main root.withdraw() from idlelib.run import fix_scaling fix_scaling(root) - tkMessageBox.showerror("Idle Cannot Start", + messagebox.showerror("Idle Cannot Start", "Idle requires tcl/tk 8.5+, not %s." % TkVersion, parent=root) raise SystemExit(1) @@ -261,7 +261,7 @@ class PyShellEditorWindow(EditorWindow): except OSError as err: if not getattr(self.root, "breakpoint_error_displayed", False): self.root.breakpoint_error_displayed = True - tkMessageBox.showerror(title='IDLE Error', + messagebox.showerror(title='IDLE Error', message='Unable to update breakpoint list:\n%s' % str(err), parent=self.text) @@ -771,7 +771,7 @@ class ModifiedInterpreter(InteractiveInterpreter): exec(code, self.locals) except SystemExit: if not self.tkconsole.closing: - if tkMessageBox.askyesno( + if messagebox.askyesno( "Exit?", "Do you want to exit altogether?", default="yes", @@ -805,7 +805,7 @@ class ModifiedInterpreter(InteractiveInterpreter): return self.tkconsole.stderr.write(s) def display_port_binding_error(self): - tkMessageBox.showerror( + messagebox.showerror( "Port Binding Error", "IDLE can't bind to a TCP/IP port, which is necessary to " "communicate with its Python execution server. This might be " @@ -816,7 +816,7 @@ class ModifiedInterpreter(InteractiveInterpreter): parent=self.tkconsole.text) def display_no_subprocess_error(self): - tkMessageBox.showerror( + messagebox.showerror( "Subprocess Connection Error", "IDLE's subprocess didn't make connection.\n" "See the 'Startup failure' section of the IDLE doc, online at\n" @@ -824,7 +824,7 @@ class ModifiedInterpreter(InteractiveInterpreter): parent=self.tkconsole.text) def display_executing_dialog(self): - tkMessageBox.showerror( + messagebox.showerror( "Already executing", "The Python Shell window is already executing a command; " "please wait until it is finished.", @@ -945,7 +945,7 @@ class PyShell(OutputWindow): def toggle_debugger(self, event=None): if self.executing: - tkMessageBox.showerror("Don't debug now", + messagebox.showerror("Don't debug now", "You can only toggle the debugger when idle", parent=self.text) self.set_debugger_indicator() @@ -1003,7 +1003,7 @@ class PyShell(OutputWindow): def close(self): "Extend EditorWindow.close()" if self.executing: - response = tkMessageBox.askokcancel( + response = messagebox.askokcancel( "Kill?", "Your program is still running!\n Do you want to kill it?", default="ok", @@ -1254,7 +1254,7 @@ class PyShell(OutputWindow): try: sys.last_traceback except: - tkMessageBox.showerror("No stack trace", + messagebox.showerror("No stack trace", "There is no stack trace yet.\n" "(sys.last_traceback is not defined)", parent=self.text) |