churchyard / rpms / python2

Forked from rpms/python2 2 years ago
Clone
4b97ee
diff -up Python-2.7.1/Lib/test/test_abc.py.cache_leak Python-2.7.1/Lib/test/test_abc.py
4b97ee
--- Python-2.7.1/Lib/test/test_abc.py.cache_leak	2010-12-28 18:06:35.551938356 -0500
4b97ee
+++ Python-2.7.1/Lib/test/test_abc.py	2010-12-28 18:09:09.021059202 -0500
4b97ee
@@ -3,6 +3,8 @@
4b97ee
 
4b97ee
 """Unit tests for abc.py."""
4b97ee
 
4b97ee
+import sys
4b97ee
+
4b97ee
 import unittest, weakref
4b97ee
 from test import test_support
4b97ee
 
4b97ee
@@ -229,8 +231,12 @@ class TestABC(unittest.TestCase):
4b97ee
         # Trigger cache.
4b97ee
         C().f()
4b97ee
         del C
4b97ee
-        test_support.gc_collect()
4b97ee
-        self.assertEqual(r(), None)
4b97ee
+        # This doesn't work in our debug build, presumably due to its use
4b97ee
+        # of COUNT_ALLOCS, which makes heap-allocated types immortal (once
4b97ee
+        # they've ever had an instance):
4b97ee
+        if not hasattr(sys, 'getcounts'):
4b97ee
+            test_support.gc_collect()
4b97ee
+            self.assertEqual(r(), None)
4b97ee
 
4b97ee
 def test_main():
4b97ee
     test_support.run_unittest(TestABC)