summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2021-11-06 19:01:39 (GMT)
committerGitHub <noreply@github.com>2021-11-06 19:01:39 (GMT)
commitcc1cbcbb2d75cacc31ff3359d83043bc7bd5a89d (patch)
treec73e81f54f4e0bf1b2baca3fe1584a73155c25e1 /Lib/tkinter
parent57457a1e5caf714034a75fe4f382b8b669ce6ed8 (diff)
downloadcpython-cc1cbcbb2d75cacc31ff3359d83043bc7bd5a89d.zip
cpython-cc1cbcbb2d75cacc31ff3359d83043bc7bd5a89d.tar.gz
cpython-cc1cbcbb2d75cacc31ff3359d83043bc7bd5a89d.tar.bz2
bpo-27313: Use non-deprecated methods for tracing (GH-29425)
Diffstat (limited to 'Lib/tkinter')
-rw-r--r--Lib/tkinter/test/test_ttk/test_extensions.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/tkinter/test/test_ttk/test_extensions.py b/Lib/tkinter/test/test_ttk/test_extensions.py
index 7fc1ebb..1220c48 100644
--- a/Lib/tkinter/test/test_ttk/test_extensions.py
+++ b/Lib/tkinter/test/test_ttk/test_extensions.py
@@ -307,14 +307,14 @@ class OptionMenuTest(AbstractTkTest, unittest.TestCase):
items = ('a', 'b', 'c')
textvar = tkinter.StringVar(self.root)
def cb_test(*args):
- self.assertEqual(textvar.get(), items[1])
- success.append(True)
+ success.append(textvar.get())
optmenu = ttk.OptionMenu(self.root, textvar, "a", *items)
optmenu.pack()
- cb_name = textvar.trace("w", cb_test)
+ cb_name = textvar.trace_add("write", cb_test)
optmenu['menu'].invoke(1)
- self.assertEqual(success, [True])
- textvar.trace_vdelete("w", cb_name)
+ self.assertEqual(success, ['b'])
+ self.assertEqual(textvar.get(), 'b')
+ textvar.trace_remove("write", cb_name)
optmenu.destroy()