Skip to content

Commit 14fc427

Browse files
committed
Tkinter, step 2: adapt imports.
1 parent 3302312 commit 14fc427

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+136
-133
lines changed

Lib/idlelib/AutoCompleteWindow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
An auto-completion window for IDLE, used by the AutoComplete extension
33
"""
4-
from Tkinter import *
4+
from tkinter import *
55
from idlelib.MultiCall import MC_SHIFT
66
from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES
77

Lib/idlelib/CallTipWindow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Used by the CallTips IDLE extension.
55
66
"""
7-
from Tkinter import *
7+
from tkinter import *
88

99
HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
1010
HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")

Lib/idlelib/CodeContext.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
not open blocks are not shown in the context hints pane.
1010
1111
"""
12-
import Tkinter
13-
from Tkconstants import TOP, LEFT, X, W, SUNKEN
12+
import tkinter
13+
from tkinter.constants import TOP, LEFT, X, W, SUNKEN
1414
import re
1515
from sys import maxsize as INFINITY
1616
from idlelib.configHandler import idleConf
@@ -69,7 +69,7 @@ def toggle_code_context_event(self, event=None):
6969
border = 0
7070
for widget in widgets:
7171
border += int(str( widget.cget('border') ))
72-
self.label = Tkinter.Label(self.editwin.top,
72+
self.label = tkinter.Label(self.editwin.top,
7373
text="\n" * (self.context_depth - 1),
7474
anchor=W, justify=LEFT,
7575
font=self.textfont,

Lib/idlelib/ColorDelegator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import re
33
import keyword
44
import builtins
5-
from Tkinter import *
5+
from tkinter import *
66
from idlelib.Delegator import Delegator
77
from idlelib.configHandler import idleConf
88

Lib/idlelib/Debugger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import bdb
33
import types
4-
from Tkinter import *
4+
from tkinter import *
55
from idlelib.WindowList import ListedToplevel
66
from idlelib.ScrolledList import ScrolledList
77
from idlelib import macosxSupport

Lib/idlelib/EditorWindow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import string
55
import imp
66
from itertools import count
7-
from Tkinter import *
8-
import tkSimpleDialog
9-
import tkMessageBox
7+
from tkinter import *
8+
import tkinter.simpledialog as tkSimpleDialog
9+
import tkinter.messagebox as tkMessageBox
1010
import traceback
1111
import webbrowser
1212

Lib/idlelib/FileList.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import os
2-
from Tkinter import *
3-
import tkMessageBox
2+
from tkinter import *
3+
import tkinter.messagebox as tkMessageBox
44

55

66
class FileList:

Lib/idlelib/GrepDialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import fnmatch
33
import sys
4-
from Tkinter import *
4+
from tkinter import *
55
from idlelib import SearchEngine
66
from idlelib.SearchDialogBase import SearchDialogBase
77

Lib/idlelib/IOBinding.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
import sys
44
import codecs
55
import tempfile
6-
import tkFileDialog
7-
import tkMessageBox
6+
import tkinter.filedialog as tkFileDialog
7+
import tkinter.messagebox as tkMessageBox
88
import re
9-
from Tkinter import *
10-
from SimpleDialog import SimpleDialog
9+
from tkinter import *
10+
from tkinter.simpledialog import SimpleDialog
1111

1212
from idlelib.configHandler import idleConf
1313

Lib/idlelib/MultiCall.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
import sys
3333
import re
34-
import Tkinter
34+
import tkinter
3535

3636
# the event type constants, which define the meaning of mc_type
3737
MC_KEYPRESS=0; MC_KEYRELEASE=1; MC_BUTTONPRESS=2; MC_BUTTONRELEASE=3;
@@ -304,7 +304,7 @@ def MultiCallCreator(widget):
304304
return _multicall_dict[widget]
305305

306306
class MultiCall (widget):
307-
assert issubclass(widget, Tkinter.Misc)
307+
assert issubclass(widget, tkinter.Misc)
308308

309309
def __init__(self, *args, **kwargs):
310310
widget.__init__(self, *args, **kwargs)
@@ -396,8 +396,8 @@ def __del__(self):
396396

397397
if __name__ == "__main__":
398398
# Test
399-
root = Tkinter.Tk()
400-
text = MultiCallCreator(Tkinter.Text)(root)
399+
root = tkinter.Tk()
400+
text = MultiCallCreator(tkinter.Text)(root)
401401
text.pack()
402402
def bindseq(seq, n=[0]):
403403
def handler(event):

0 commit comments

Comments
 (0)