Skip to content

Commit

Permalink
bpo-45160: Fix refleak in test_ttk_guionly introduced in GH-28291 (GH…
Browse files Browse the repository at this point in the history
…-29416) (GH-29421)

(cherry picked from commit 54d1e3f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
  • Loading branch information
miss-islington and ambv authored Nov 5, 2021
1 parent 363ecb3 commit 099a94f
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 099a94f

Please sign in to comment.