]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 87721 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Tue, 4 Jan 2011 00:32:18 +0000 (00:32 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Tue, 4 Jan 2011 00:32:18 +0000 (00:32 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87721 | antoine.pitrou | 2011-01-04 01:24:03 +0100 (mar., 04 janv. 2011) | 3 lines

  Issue #10267: Fix refleak in test_ttk_guionly.  Patch by Hirokazu Yamamoto.
........

Lib/test/test_ttk_guionly.py

index 4e43a1873f881abec4fee7c1f7c73563ad8632cf..d70863a287e9c3fff791cc623f33afeceabf3b02 100644 (file)
@@ -9,6 +9,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()
@@ -23,8 +24,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)