Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 560f9da

Browse files
committed
Issue #10267: Fix refleak in test_ttk_guionly. Patch by Hirokazu Yamamoto.
1 parent 04ba966 commit 560f9da

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Lib/test/test_ttk_guionly.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from _tkinter import TclError
99
from tkinter import ttk
1010
from tkinter.test import runtktests
11+
from tkinter.test.support import get_tk_root
1112

1213
try:
1314
ttk.Button()
@@ -22,8 +23,11 @@ def test_main(enable_gui=False):
2223
elif 'gui' not in support.use_resources:
2324
support.use_resources.append('gui')
2425

25-
support.run_unittest(
26-
*runtktests.get_tests(text=False, packages=['test_ttk']))
26+
try:
27+
support.run_unittest(
28+
*runtktests.get_tests(text=False, packages=['test_ttk']))
29+
finally:
30+
get_tk_root().destroy()
2731

2832
if __name__ == '__main__':
2933
test_main(enable_gui=True)

0 commit comments

Comments
 (0)