]> granicus.if.org Git - python/commitdiff
Issue #10267: Fix refleak in test_ttk_guionly. Patch by Hirokazu Yamamoto.
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 4 Jan 2011 00:24:03 +0000 (00:24 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 4 Jan 2011 00:24:03 +0000 (00:24 +0000)
Lib/test/test_ttk_guionly.py

index eca8bcf86c7b7b91811ea4d76d45ea5596d6f488..bff4fc168be90a6702e1fa1c5c8eea61d470b8b0 100644 (file)
@@ -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)