summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-11-06 19:23:28 (GMT)
committerGitHub <noreply@github.com>2021-11-06 19:23:28 (GMT)
commit376218e1c65c029c24e45ca408a14f681cf1aeae (patch)
tree470d705be6d674297a8e3f305f40a3314a0a9d90 /Lib
parent643f50ca5e9e12a4d8269ddc8baf2279d8608745 (diff)
downloadcpython-376218e1c65c029c24e45ca408a14f681cf1aeae.zip
cpython-376218e1c65c029c24e45ca408a14f681cf1aeae.tar.gz
cpython-376218e1c65c029c24e45ca408a14f681cf1aeae.tar.bz2
bpo-27313: Use non-deprecated methods for tracing (GH-29425) (GH-29451)
(cherry picked from commit cc1cbcbb2d75cacc31ff3359d83043bc7bd5a89d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib')
-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()