]> granicus.if.org Git - python/commitdiff
Issue #20743: Fix a reference leak in test_tcl.
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 23 Feb 2014 18:39:06 +0000 (19:39 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 23 Feb 2014 18:39:06 +0000 (19:39 +0100)
Lib/test/test_tcl.py
Misc/NEWS

index dda0c7ac79207868362e94dd7c0fc5f5dda9ef15..5226ee676e9d01bae8768ab0d6c856b43f5b0480 100644 (file)
@@ -376,6 +376,7 @@ class TclTest(unittest.TestCase):
             result = arg
             return arg
         self.interp.createcommand('testfunc', testfunc)
+        self.addCleanup(self.interp.tk.deletecommand, 'testfunc')
         def check(value, expected, eq=self.assertEqual):
             r = self.interp.call('testfunc', value)
             self.assertIsInstance(result, str)
index 006f3bfce299e7ff4019f8ed01b579b58ce6fbe8..0bb54c5f88963e3f58e221d8b1eeeccb9100c3d0 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -117,6 +117,8 @@ IDLE
 Tests
 -----
 
+- Issue #20743: Fix a reference leak in test_tcl.
+
 - Issue #20510: Rewrote test_exit in test_sys to match existing comments,
   use modern unittest features, and use helpers from test.script_helper
   instead of using subprocess directly.  Patch by Gareth Rees.