]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Removing the test of Element that causes ref-leak in GC (issue #14464).
authorEli Bendersky <eliben@gmail.com>
Sun, 1 Apr 2012 14:40:17 +0000 (17:40 +0300)
committerEli Bendersky <eliben@gmail.com>
Sun, 1 Apr 2012 14:40:17 +0000 (17:40 +0300)
I will now continue investigating the cause of the ref-leak, but I wanted
to remove the test so that the refcount test in the buildbots could be clean.
The whole change (adding GC to Element) is not reverted because it improved
the situation (GC works for immediate cycles) and didn't cause regressions
(the test is new and was added together with the fix).

Lib/test/test_xml_etree.py

index bd2a826014828ddb86b8485df618cd86dd3ad16b..aa9a40d9208d4881613146638be67a1745b7f1aa 100644 (file)
@@ -1859,16 +1859,6 @@ class BasicElementTest(unittest.TestCase):
         gc_collect()
         self.assertIsNone(wref())
 
-        # A longer cycle: d->e->e2->d
-        e = ET.Element('joe')
-        d = Dummy()
-        d.dummyref = e
-        wref = weakref.ref(d)
-        e2 = ET.SubElement(e, 'foo', attr=d)
-        del d, e, e2
-        gc_collect()
-        self.assertIsNone(wref())
-
 
 class ElementTreeTest(unittest.TestCase):
     def test_istype(self):