summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/test
diff options
context:
space:
mode:
authorƁukasz Langa <lukasz@langa.pl>2021-11-05 08:51:31 (GMT)
committerGitHub <noreply@github.com>2021-11-05 08:51:31 (GMT)
commit54d1e3f72ed1ad8e860888c30ee7a285b931c0d1 (patch)
tree1044e9671aff816e4aca9ad4d96c7ac0f88e98ef /Lib/tkinter/test
parent3167df16212e27f8aac1e5f39c0644a97b593406 (diff)
downloadcpython-54d1e3f72ed1ad8e860888c30ee7a285b931c0d1.zip
cpython-54d1e3f72ed1ad8e860888c30ee7a285b931c0d1.tar.gz
cpython-54d1e3f72ed1ad8e860888c30ee7a285b931c0d1.tar.bz2
bpo-45160: Fix refleak in test_ttk_guionly introduced in GH-28291 (GH-29416)
Diffstat (limited to 'Lib/tkinter/test')
-rw-r--r--Lib/tkinter/test/test_ttk/test_extensions.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/tkinter/test/test_ttk/test_extensions.py b/Lib/tkinter/test/test_ttk/test_extensions.py
index cddd1f2..7fc1ebb 100644
--- a/Lib/tkinter/test/test_ttk/test_extensions.py
+++ b/Lib/tkinter/test/test_ttk/test_extensions.py
@@ -310,9 +310,12 @@ class OptionMenuTest(AbstractTkTest, unittest.TestCase):
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):