summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ttk_guionly.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-01-04 00:24:03 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-01-04 00:24:03 (GMT)
commit560f9dab55701654706b0d257d5d8f34f633bb52 (patch)
tree1ab5916790c5f79d85e1dbbd838a25dddda51352 /Lib/test/test_ttk_guionly.py
parent04ba966eab194c8d26b1e67c95f62b86c9120921 (diff)
downloadcpython-560f9dab55701654706b0d257d5d8f34f633bb52.zip
cpython-560f9dab55701654706b0d257d5d8f34f633bb52.tar.gz
cpython-560f9dab55701654706b0d257d5d8f34f633bb52.tar.bz2
Issue #10267: Fix refleak in test_ttk_guionly. Patch by Hirokazu Yamamoto.
Diffstat (limited to 'Lib/test/test_ttk_guionly.py')
-rw-r--r--Lib/test/test_ttk_guionly.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_ttk_guionly.py b/Lib/test/test_ttk_guionly.py
index eca8bcf..bff4fc1 100644
--- a/Lib/test/test_ttk_guionly.py
+++ b/Lib/test/test_ttk_guionly.py
@@ -8,6 +8,7 @@ support.import_module('_tkinter')
from _tkinter import TclError
from tkinter import ttk
from tkinter.test import runtktests
+from tkinter.test.support import get_tk_root
try:
ttk.Button()
@@ -22,8 +23,11 @@ def test_main(enable_gui=False):
elif 'gui' not in support.use_resources:
support.use_resources.append('gui')
- support.run_unittest(
- *runtktests.get_tests(text=False, packages=['test_ttk']))
+ try:
+ support.run_unittest(
+ *runtktests.get_tests(text=False, packages=['test_ttk']))
+ finally:
+ get_tk_root().destroy()
if __name__ == '__main__':
test_main(enable_gui=True)