Skip to content

Commit

Permalink
bpo-27313: Use non-deprecated methods for tracing (GH-29425) (GH-29450)
Browse files Browse the repository at this point in the history
(cherry picked from commit cc1cbcb)

Co-authored-by: Serhiy Storchaka <[email protected]>
  • Loading branch information
miss-islington and serhiy-storchaka authored Nov 6, 2021
1 parent e53cb98 commit 8fdf6c6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Lib/tkinter/test/test_ttk/test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,14 @@ def test_trace_variable(self):
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()


Expand Down

0 comments on commit 8fdf6c6

Please sign in to comment.