Skip to content

Commit

Permalink
bpo-45160: Fix refleak in test_ttk_guionly introduced in pythonGH-28291
Browse files Browse the repository at this point in the history
  • Loading branch information
ambv authored Nov 5, 2021
1 parent 3167df1 commit 54d1e3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/tkinter/test/test_ttk/test_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,12 @@ def cb_test(*args):
self.assertEqual(textvar.get(), items[1])
success.append(True)
optmenu = ttk.OptionMenu(self.root, textvar, "a", *items)
textvar.trace("w", cb_test)
optmenu.pack()
cb_name = textvar.trace("w", cb_test)
optmenu['menu'].invoke(1)
self.assertEqual(success, [True])
textvar.trace_vdelete("w", cb_name)
optmenu.destroy()


class DefaultRootTest(AbstractDefaultRootTest, unittest.TestCase):
Expand Down

0 comments on commit 54d1e3f

Please sign in to comment.