mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
cf19cc3b92
commit
879986d8a9
13 changed files with 66 additions and 67 deletions
|
@ -4,7 +4,7 @@ from idlelib import searchengine as se
|
|||
import unittest
|
||||
# from test.support import requires
|
||||
from tkinter import BooleanVar, StringVar, TclError # ,Tk, Text
|
||||
import tkinter.messagebox as tkMessageBox
|
||||
from tkinter import messagebox
|
||||
from idlelib.idle_test.mock_tk import Var, Mbox
|
||||
from idlelib.idle_test.mock_tk import Text as mockText
|
||||
import re
|
||||
|
@ -19,13 +19,13 @@ def setUpModule():
|
|||
# Replace s-e module tkinter imports other than non-gui TclError.
|
||||
se.BooleanVar = Var
|
||||
se.StringVar = Var
|
||||
se.tkMessageBox = Mbox
|
||||
se.messagebox = Mbox
|
||||
|
||||
def tearDownModule():
|
||||
# Restore 'just in case', though other tests should also replace.
|
||||
se.BooleanVar = BooleanVar
|
||||
se.StringVar = StringVar
|
||||
se.tkMessageBox = tkMessageBox
|
||||
se.messagebox = messagebox
|
||||
|
||||
|
||||
class Mock:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue