Tkinter rename, step 2: fix imports and add stub modules.

This commit is contained in:
Georg Brandl 2008-05-16 15:48:15 +00:00
parent bbc57d73a0
commit ad9afeb8f0
53 changed files with 206 additions and 85 deletions

View File

@ -1,7 +1,7 @@
""" """
An auto-completion window for IDLE, used by the AutoComplete extension An auto-completion window for IDLE, used by the AutoComplete extension
""" """
from Tkinter import * from tkinter import *
from MultiCall import MC_SHIFT from MultiCall import MC_SHIFT
import AutoComplete import AutoComplete

View File

@ -4,7 +4,7 @@ After ToolTip.py, which uses ideas gleaned from PySol
Used by the CallTips IDLE extension. Used by the CallTips IDLE extension.
""" """
from Tkinter import * from tkinter import *
HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>" HIDE_VIRTUAL_EVENT_NAME = "<<calltipwindow-hide>>"
HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>") HIDE_SEQUENCES = ("<Key-Escape>", "<FocusOut>")

View File

@ -9,8 +9,8 @@ variable in the CodeContext section of config-extensions.def. Lines which do
not open blocks are not shown in the context hints pane. not open blocks are not shown in the context hints pane.
""" """
import Tkinter import tkinter
from Tkconstants import TOP, LEFT, X, W, SUNKEN from tkinter.constants import TOP, LEFT, X, W, SUNKEN
from configHandler import idleConf from configHandler import idleConf
import re import re
from sys import maxint as INFINITY from sys import maxint as INFINITY
@ -69,7 +69,7 @@ class CodeContext:
border = 0 border = 0
for widget in widgets: for widget in widgets:
border += int(str( widget.cget('border') )) border += int(str( widget.cget('border') ))
self.label = Tkinter.Label(self.editwin.top, self.label = tkinter.Label(self.editwin.top,
text="\n" * (self.context_depth - 1), text="\n" * (self.context_depth - 1),
anchor=W, justify=LEFT, anchor=W, justify=LEFT,
font=self.textfont, font=self.textfont,

View File

@ -2,7 +2,7 @@ import time
import re import re
import keyword import keyword
import __builtin__ import __builtin__
from Tkinter import * from tkinter import *
from Delegator import Delegator from Delegator import Delegator
from configHandler import idleConf from configHandler import idleConf

View File

@ -1,7 +1,7 @@
import os import os
import bdb import bdb
import types import types
from Tkinter import * from tkinter import *
from WindowList import ListedToplevel from WindowList import ListedToplevel
from ScrolledList import ScrolledList from ScrolledList import ScrolledList
import macosxSupport import macosxSupport

View File

@ -3,9 +3,9 @@ import os
import re import re
import imp import imp
from itertools import count from itertools import count
from Tkinter import * from tkinter import *
import tkSimpleDialog import tkinter.simpledialog as tkSimpleDialog
import tkMessageBox import tkinter.messagebox as tkMessageBox
from MultiCall import MultiCallCreator from MultiCall import MultiCallCreator
import webbrowser import webbrowser
@ -45,7 +45,7 @@ class EditorWindow(object):
from UndoDelegator import UndoDelegator from UndoDelegator import UndoDelegator
from IOBinding import IOBinding, filesystemencoding, encoding from IOBinding import IOBinding, filesystemencoding, encoding
import Bindings import Bindings
from Tkinter import Toplevel from tkinter import Toplevel
from MultiStatusBar import MultiStatusBar from MultiStatusBar import MultiStatusBar
help_url = None help_url = None

View File

@ -1,6 +1,6 @@
import os import os
from Tkinter import * from tkinter import *
import tkMessageBox import tkinter.messagebox as tkMessageBox
class FileList: class FileList:

View File

@ -1,7 +1,7 @@
import os import os
import fnmatch import fnmatch
import sys import sys
from Tkinter import * from tkinter import *
import SearchEngine import SearchEngine
from SearchDialogBase import SearchDialogBase from SearchDialogBase import SearchDialogBase

View File

@ -10,11 +10,11 @@ import types
import sys import sys
import codecs import codecs
import tempfile import tempfile
import tkFileDialog import tkinter.filedialog as tkFileDialog
import tkMessageBox import tkinter.messagebox as tkMessageBox
import re import re
from Tkinter import * from tkinter import *
from SimpleDialog import SimpleDialog from tkinter.simpledialog import SimpleDialog
from configHandler import idleConf from configHandler import idleConf

View File

@ -32,7 +32,7 @@ Each function will be called at most once for each event.
import sys import sys
import string import string
import re import re
import Tkinter import tkinter
# the event type constants, which define the meaning of mc_type # the event type constants, which define the meaning of mc_type
MC_KEYPRESS=0; MC_KEYRELEASE=1; MC_BUTTONPRESS=2; MC_BUTTONRELEASE=3; MC_KEYPRESS=0; MC_KEYRELEASE=1; MC_BUTTONPRESS=2; MC_BUTTONRELEASE=3;
@ -292,7 +292,7 @@ def MultiCallCreator(widget):
return _multicall_dict[widget] return _multicall_dict[widget]
class MultiCall (widget): class MultiCall (widget):
assert issubclass(widget, Tkinter.Misc) assert issubclass(widget, tkinter.Misc)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
apply(widget.__init__, (self,)+args, kwargs) apply(widget.__init__, (self,)+args, kwargs)
@ -382,8 +382,8 @@ def MultiCallCreator(widget):
if __name__ == "__main__": if __name__ == "__main__":
# Test # Test
root = Tkinter.Tk() root = tkinter.Tk()
text = MultiCallCreator(Tkinter.Text)(root) text = MultiCallCreator(tkinter.Text)(root)
text.pack() text.pack()
def bindseq(seq, n=[0]): def bindseq(seq, n=[0]):
def handler(event): def handler(event):

View File

@ -1,4 +1,4 @@
from Tkinter import * from tkinter import *
class MultiStatusBar(Frame): class MultiStatusBar(Frame):

View File

@ -136,7 +136,7 @@ def make_objecttreeitem(labeltext, object, setfunction=None):
def _test(): def _test():
import sys import sys
from Tkinter import Tk from tkinter import Tk
root = Tk() root = Tk()
root.configure(bd=0, bg="yellow") root.configure(bd=0, bg="yellow")
root.focus_set() root.focus_set()

View File

@ -1,7 +1,7 @@
from Tkinter import * from tkinter import *
from EditorWindow import EditorWindow from EditorWindow import EditorWindow
import re import re
import tkMessageBox import tkinter.messagebox as tkMessageBox
import IOBinding import IOBinding
class OutputWindow(EditorWindow): class OutputWindow(EditorWindow):

View File

@ -81,5 +81,5 @@ def main():
root.mainloop() root.mainloop()
if __name__ == "__main__": if __name__ == "__main__":
from Tkinter import * from tkinter import *
main() main()

View File

@ -17,12 +17,12 @@ import linecache
from code import InteractiveInterpreter from code import InteractiveInterpreter
try: try:
from Tkinter import * from tkinter import *
except ImportError: except ImportError:
print>>sys.__stderr__, "** IDLE can't import Tkinter. " \ print>>sys.__stderr__, "** IDLE can't import tkinter. " \
"Your Python may not be configured for Tk. **" "Your Python may not be configured for Tk. **"
sys.exit(1) sys.exit(1)
import tkMessageBox import tkinter.messagebox as tkMessageBox
from EditorWindow import EditorWindow, fixwordbreaks from EditorWindow import EditorWindow, fixwordbreaks
from FileList import FileList from FileList import FileList
@ -992,8 +992,8 @@ class PyShell(OutputWindow):
(sys.version, sys.platform, self.COPYRIGHT, (sys.version, sys.platform, self.COPYRIGHT,
self.firewallmessage, idlever.IDLE_VERSION, nosub)) self.firewallmessage, idlever.IDLE_VERSION, nosub))
self.showprompt() self.showprompt()
import Tkinter import tkinter
Tkinter._default_root = None # 03Jan04 KBK What's this? tkinter._default_root = None # 03Jan04 KBK What's this?
return True return True
def readline(self): def readline(self):

View File

@ -1,4 +1,4 @@
from Tkinter import * from tkinter import *
import SearchEngine import SearchEngine
from SearchDialogBase import SearchDialogBase from SearchDialogBase import SearchDialogBase

View File

@ -22,7 +22,7 @@ import re
import string import string
import tabnanny import tabnanny
import tokenize import tokenize
import tkMessageBox import tkinter.messagebox as tkMessageBox
import PyShell import PyShell
from configHandler import idleConf from configHandler import idleConf

View File

@ -1,4 +1,4 @@
from Tkinter import * from tkinter import *
class ScrolledList: class ScrolledList:

View File

@ -1,4 +1,4 @@
from Tkinter import * from tkinter import *
import SearchEngine import SearchEngine
from SearchDialogBase import SearchDialogBase from SearchDialogBase import SearchDialogBase

View File

@ -1,4 +1,4 @@
from Tkinter import * from tkinter import *
class SearchDialogBase: class SearchDialogBase:

View File

@ -1,6 +1,6 @@
import re import re
from Tkinter import * from tkinter import *
import tkMessageBox import tkinter.messagebox as tkMessageBox
def get(root): def get(root):
if not hasattr(root, "_searchengine"): if not hasattr(root, "_searchengine"):

View File

@ -7,7 +7,7 @@ from ObjectBrowser import ObjectTreeItem, make_objecttreeitem
def StackBrowser(root, flist=None, tb=None, top=None): def StackBrowser(root, flist=None, tb=None, top=None):
if top is None: if top is None:
from Tkinter import Toplevel from tkinter import Toplevel
top = Toplevel(root) top = Toplevel(root)
sc = ScrolledCanvas(top, bg="white", highlightthickness=0) sc = ScrolledCanvas(top, bg="white", highlightthickness=0)
sc.frame.pack(expand=1, fill="both") sc.frame.pack(expand=1, fill="both")
@ -128,7 +128,7 @@ def _test():
reload(testcode) reload(testcode)
except: except:
sys.last_type, sys.last_value, sys.last_traceback = sys.exc_info() sys.last_type, sys.last_value, sys.last_traceback = sys.exc_info()
from Tkinter import Tk from tkinter import Tk
root = Tk() root = Tk()
StackBrowser(None, top=root) StackBrowser(None, top=root)
root.mainloop() root.mainloop()

View File

@ -3,7 +3,7 @@
# may be useful for some purposes in (or almost in ;) the current project scope # may be useful for some purposes in (or almost in ;) the current project scope
# Ideas gleaned from PySol # Ideas gleaned from PySol
from Tkinter import * from tkinter import *
class ToolTipBase: class ToolTipBase:

View File

@ -15,7 +15,7 @@
# - optimize tree redraw after expand of subnode # - optimize tree redraw after expand of subnode
import os import os
from Tkinter import * from tkinter import *
import imp import imp
import ZoomHeight import ZoomHeight

View File

@ -1,5 +1,5 @@
import string import string
from Tkinter import * from tkinter import *
from Delegator import Delegator from Delegator import Delegator
#$ event <<redo>> #$ event <<redo>>

View File

@ -1,4 +1,4 @@
from Tkinter import * from tkinter import *
class WidgetRedirector: class WidgetRedirector:

View File

@ -1,4 +1,4 @@
from Tkinter import * from tkinter import *
class WindowList: class WindowList:

View File

@ -2,7 +2,7 @@
""" """
from Tkinter import * from tkinter import *
import os import os
import os.path import os.path
import textView import textView

View File

@ -9,8 +9,10 @@ Note that tab width in IDLE is currently fixed at eight due to Tk issues.
Refer to comments in EditorWindow autoindent code for details. Refer to comments in EditorWindow autoindent code for details.
""" """
from Tkinter import * from tkinter import *
import tkMessageBox, tkColorChooser, tkFont import tkinter.messagebox as tkMessageBox
import tkinter.colorchooser as tkColorChooser
import tkinter.font as tkFont
import string import string
from configHandler import idleConf from configHandler import idleConf

View File

@ -3,9 +3,9 @@
import os import os
import sys import sys
from Tkinter import * from tkinter import *
import tkMessageBox import tkinter.messagebox as tkMessageBox
import tkFileDialog import tkinter.filedialog as tkFileDialog
class GetHelpSourceDialog(Toplevel): class GetHelpSourceDialog(Toplevel):
def __init__(self, parent, title, menuItem='', filePath=''): def __init__(self, parent, title, menuItem='', filePath=''):

View File

@ -2,8 +2,8 @@
Dialog that allows user to specify a new config file section name. Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names. Used to get new highlight theme and keybinding set names.
""" """
from Tkinter import * from tkinter import *
import tkMessageBox import tkinter.messagebox as tkMessageBox
class GetCfgSectionNameDialog(Toplevel): class GetCfgSectionNameDialog(Toplevel):
def __init__(self,parent,title,message,usedNames): def __init__(self,parent,title,message,usedNames):

View File

@ -2,8 +2,8 @@
OptionMenu widget modified to allow dynamic menu reconfiguration OptionMenu widget modified to allow dynamic menu reconfiguration
and setting of highlightthickness and setting of highlightthickness
""" """
from Tkinter import OptionMenu from tkinter import OptionMenu
from Tkinter import _setit from tkinter import _setit
import copy import copy
class DynOptionMenu(OptionMenu): class DynOptionMenu(OptionMenu):

View File

@ -1,8 +1,8 @@
""" """
Dialog for building Tkinter accelerator key bindings Dialog for building Tkinter accelerator key bindings
""" """
from Tkinter import * from tkinter import *
import tkMessageBox import tkinter.messagebox as tkMessageBox
import string import string
class GetKeysDialog(Toplevel): class GetKeysDialog(Toplevel):

View File

@ -3,7 +3,7 @@ A number of function that enhance IDLE on MacOSX when it used as a normal
GUI application (as opposed to an X11 application). GUI application (as opposed to an X11 application).
""" """
import sys import sys
import Tkinter import tkinter
def runningAsOSXApp(): def runningAsOSXApp():
""" Returns True iff running from the IDLE.app bundle on OSX """ """ Returns True iff running from the IDLE.app bundle on OSX """
@ -26,7 +26,7 @@ def addOpenEventSupport(root, flist):
def hideTkConsole(root): def hideTkConsole(root):
try: try:
root.tk.call('console', 'hide') root.tk.call('console', 'hide')
except Tkinter.TclError: except tkinter.TclError:
# Some versions of the Tk framework don't have a console object # Some versions of the Tk framework don't have a console object
pass pass
@ -46,7 +46,7 @@ def overrideRootMenu(root, flist):
# #
# Due to a (mis-)feature of TkAqua the user will also see an empty Help # Due to a (mis-)feature of TkAqua the user will also see an empty Help
# menu. # menu.
from Tkinter import Menu, Text, Text from tkinter import Menu, Text, Text
from EditorWindow import prepstr, get_accelerator from EditorWindow import prepstr, get_accelerator
import Bindings import Bindings
import WindowList import WindowList

View File

@ -127,9 +127,9 @@ def manage_socket(address):
server.handle_request() # A single request only server.handle_request() # A single request only
def show_socket_error(err, address): def show_socket_error(err, address):
import Tkinter import tkinter
import tkMessageBox import tkinter.messagebox as tkMessageBox
root = Tkinter.Tk() root = tkinter.Tk()
root.withdraw() root.withdraw()
if err[0] == 61: # connection refused if err[0] == 61: # connection refused
msg = "IDLE's subprocess can't connect to %s:%d. This may be due "\ msg = "IDLE's subprocess can't connect to %s:%d. This may be due "\

View File

@ -7,7 +7,7 @@ TabbedPageSet -- A Tkinter implementation of a tabbed-page widget.
TabSet -- A widget containing tabs (buttons) in one or more rows. TabSet -- A widget containing tabs (buttons) in one or more rows.
""" """
from Tkinter import * from tkinter import *
class InvalidNameError(Exception): pass class InvalidNameError(Exception): pass
class AlreadyExistsError(Exception): pass class AlreadyExistsError(Exception): pass

View File

@ -2,8 +2,8 @@
""" """
from Tkinter import * from tkinter import *
import tkMessageBox import tkinter.messagebox as tkMessageBox
class TextViewer(Toplevel): class TextViewer(Toplevel):
"""A simple text viewer dialog for IDLE """A simple text viewer dialog for IDLE
@ -68,7 +68,7 @@ def view_file(parent, title, filename, encoding=None):
else: else:
textFile = open(filename, 'r') textFile = open(filename, 'r')
except IOError: except IOError:
import tkMessageBox import tkinter.messagebox as tkMessageBox
tkMessageBox.showerror(title='File Load Error', tkMessageBox.showerror(title='File Load Error',
message='Unable to load file %r .' % filename, message='Unable to load file %r .' % filename,
parent=parent) parent=parent)

View File

@ -7,7 +7,7 @@ from warnings import warnpy3k
warnpy3k("the Canvas module has been removed in Python 3.0", stacklevel=2) warnpy3k("the Canvas module has been removed in Python 3.0", stacklevel=2)
del warnpy3k del warnpy3k
from Tkinter import Canvas, _cnfmerge, _flatten from tkinter import Canvas, _cnfmerge, _flatten
class CanvasItem: class CanvasItem:

8
Lib/lib-tk/FileDialog.py Normal file
View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the FileDialog module has been renamed "
"to 'tkinter.filedialog' in Python 3.0", stacklevel=2)
import tkinter.filedialog
sys.modules[__name__] = tkinter.filedialog

8
Lib/lib-tk/FixTk.py Normal file
View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the FixTk module has been renamed "
"to 'tkinter._fix' in Python 3.0", stacklevel=2)
import tkinter._fix
sys.modules[__name__] = tkinter._fix

View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the ScrolledText module has been renamed "
"to 'tkinter.scrolledtext' in Python 3.0", stacklevel=2)
import tkinter.scrolledtext
sys.modules[__name__] = tkinter.scrolledtext

View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the SimpleDialog module has been renamed "
"to 'tkinter.simpledialog' in Python 3.0", stacklevel=2)
import tkinter.simpledialog
sys.modules[__name__] = tkinter.simpledialog

8
Lib/lib-tk/Tix.py Normal file
View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the Tix module has been renamed "
"to 'tkinter.tix' in Python 3.0", stacklevel=2)
import tkinter.tix
sys.modules[__name__] = tkinter.tix

View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the Tkconstants module has been renamed "
"to 'tkinter.constants' in Python 3.0", stacklevel=2)
import tkinter.constants
sys.modules[__name__] = tkinter.constants

8
Lib/lib-tk/Tkdnd.py Normal file
View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the Tkdnd module has been renamed "
"to 'tkinter.dnd' in Python 3.0", stacklevel=2)
import tkinter.dnd
sys.modules[__name__] = tkinter.dnd

8
Lib/lib-tk/Tkinter.py Normal file
View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the Tkinter module has been renamed "
"to 'tkinter' in Python 3.0", stacklevel=2)
import tkinter
sys.modules[__name__] = tkinter

View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the tkColorChooser module has been renamed "
"to 'tkinter.colorchooser' in Python 3.0", stacklevel=2)
import tkinter.colorchooser
sys.modules[__name__] = tkinter.colorchooser

View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the tkCommonDialog module has been renamed "
"to 'tkinter.commondialog' in Python 3.0", stacklevel=2)
import tkinter.commondialog
sys.modules[__name__] = tkinter.commondialog

8
Lib/lib-tk/tkFont.py Normal file
View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the tkFont module has been renamed "
"to 'tkinter.font' in Python 3.0", stacklevel=2)
import tkinter.font
sys.modules[__name__] = tkinter.font

View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the tkMessageBox module has been renamed "
"to 'tkinter.messagebox' in Python 3.0", stacklevel=2)
import tkinter.messagebox
sys.modules[__name__] = tkinter.messagebox

8
Lib/lib-tk/turtle.py Normal file
View File

@ -0,0 +1,8 @@
import sys
from warnings import warnpy3k
warnpy3k("the turtle module has been renamed "
"to 'tkinter.turtle' in Python 3.0", stacklevel=2)
import tkinter.turtle
sys.modules[__name__] = tkinter.turtle

View File

@ -2017,20 +2017,20 @@ def gui():
self.server = None self.server = None
self.scanner = None self.scanner = None
import Tkinter import tkinter
self.server_frm = Tkinter.Frame(window) self.server_frm = tkinter.Frame(window)
self.title_lbl = Tkinter.Label(self.server_frm, self.title_lbl = tkinter.Label(self.server_frm,
text='Starting server...\n ') text='Starting server...\n ')
self.open_btn = Tkinter.Button(self.server_frm, self.open_btn = tkinter.Button(self.server_frm,
text='open browser', command=self.open, state='disabled') text='open browser', command=self.open, state='disabled')
self.quit_btn = Tkinter.Button(self.server_frm, self.quit_btn = tkinter.Button(self.server_frm,
text='quit serving', command=self.quit, state='disabled') text='quit serving', command=self.quit, state='disabled')
self.search_frm = Tkinter.Frame(window) self.search_frm = tkinter.Frame(window)
self.search_lbl = Tkinter.Label(self.search_frm, text='Search for') self.search_lbl = tkinter.Label(self.search_frm, text='Search for')
self.search_ent = Tkinter.Entry(self.search_frm) self.search_ent = tkinter.Entry(self.search_frm)
self.search_ent.bind('<Return>', self.search) self.search_ent.bind('<Return>', self.search)
self.stop_btn = Tkinter.Button(self.search_frm, self.stop_btn = tkinter.Button(self.search_frm,
text='stop', pady=0, command=self.stop, state='disabled') text='stop', pady=0, command=self.stop, state='disabled')
if sys.platform == 'win32': if sys.platform == 'win32':
# Trying to hide and show this button crashes under Windows. # Trying to hide and show this button crashes under Windows.
@ -2049,17 +2049,17 @@ def gui():
self.search_ent.focus_set() self.search_ent.focus_set()
font = ('helvetica', sys.platform == 'win32' and 8 or 10) font = ('helvetica', sys.platform == 'win32' and 8 or 10)
self.result_lst = Tkinter.Listbox(window, font=font, height=6) self.result_lst = tkinter.Listbox(window, font=font, height=6)
self.result_lst.bind('<Button-1>', self.select) self.result_lst.bind('<Button-1>', self.select)
self.result_lst.bind('<Double-Button-1>', self.goto) self.result_lst.bind('<Double-Button-1>', self.goto)
self.result_scr = Tkinter.Scrollbar(window, self.result_scr = tkinter.Scrollbar(window,
orient='vertical', command=self.result_lst.yview) orient='vertical', command=self.result_lst.yview)
self.result_lst.config(yscrollcommand=self.result_scr.set) self.result_lst.config(yscrollcommand=self.result_scr.set)
self.result_frm = Tkinter.Frame(window) self.result_frm = tkinter.Frame(window)
self.goto_btn = Tkinter.Button(self.result_frm, self.goto_btn = tkinter.Button(self.result_frm,
text='go to selected', command=self.goto) text='go to selected', command=self.goto)
self.hide_btn = Tkinter.Button(self.result_frm, self.hide_btn = tkinter.Button(self.result_frm,
text='hide results', command=self.hide) text='hide results', command=self.hide)
self.goto_btn.pack(side='left', fill='x', expand=1) self.goto_btn.pack(side='left', fill='x', expand=1)
self.hide_btn.pack(side='right', fill='x', expand=1) self.hide_btn.pack(side='right', fill='x', expand=1)
@ -2179,9 +2179,9 @@ def gui():
self.stop() self.stop()
self.collapse() self.collapse()
import Tkinter import tkinter
try: try:
root = Tkinter.Tk() root = tkinter.Tk()
# Tk will crash if pythonw.exe has an XP .manifest # Tk will crash if pythonw.exe has an XP .manifest
# file and the root has is not destroyed explicitly. # file and the root has is not destroyed explicitly.
# If the problem is ever fixed in Tk, the explicit # If the problem is ever fixed in Tk, the explicit

View File

@ -212,6 +212,21 @@ class TestStdlibRenames(unittest.TestCase):
'SocketServer': 'socketserver', 'SocketServer': 'socketserver',
'ConfigParser': 'configparser', 'ConfigParser': 'configparser',
'repr': 'reprlib', 'repr': 'reprlib',
'FileDialog': 'tkinter.filedialog',
'FixTk': 'tkinter._fix',
'ScrolledText': 'tkinter.scrolledtext',
'SimpleDialog': 'tkinter.simpledialog',
'Tix': 'tkinter.tix',
'tkColorChooser': 'tkinter.colorchooser',
'tkCommonDialog': 'tkinter.commondialog',
'Tkconstants': 'tkinter.constants',
'Tkdnd': 'tkinter.dnd',
'tkFileDialog': 'tkinter.filedialog',
'tkFont': 'tkinter.font',
'Tkinter': 'tkinter',
'tkMessageBox': 'tkinter.messagebox',
'tkSimpleDialog': 'tkinter.simpledialog',
'turtle': 'tkinter.turtle'
} }
def check_rename(self, module_name, new_module_name): def check_rename(self, module_name, new_module_name):