[Python-checkins] cpython (2.7): Issue #20743: Fix a reference leak in test_tcl.

antoine.pitrou python-checkins at python.org
Sun Feb 23 19:46:31 CET 2014


http://hg.python.org/cpython/rev/00393de6919d
changeset:   89344:00393de6919d
branch:      2.7
parent:      89321:b514339e41ef
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Sun Feb 23 19:39:06 2014 +0100
summary:
  Issue #20743: Fix a reference leak in test_tcl.

files:
  Lib/test/test_tcl.py |  1 +
  Misc/NEWS            |  2 ++
  2 files changed, 3 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -386,6 +386,7 @@
             result.append(arg)
             return arg
         self.interp.createcommand('testfunc', testfunc)
+        self.addCleanup(self.interp.tk.deletecommand, 'testfunc')
         def check(value, expected, expected2=None, eq=self.assertEqual):
             if expected2 is None:
                 expected2 = expected
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -249,6 +249,8 @@
 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.  Initial patch by Gareth Rees.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list