Blame SOURCES/00141-fix-test_gc_with_COUNT_ALLOCS.patch
|
|
6e8c2f |
diff -up Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS Python-2.7.2/Lib/test/test_gc.py
|
|
|
6e8c2f |
--- Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS 2011-09-08 19:49:13.045924309 -0400
|
|
|
6e8c2f |
+++ Python-2.7.2/Lib/test/test_gc.py 2011-09-08 19:50:07.035920617 -0400
|
|
|
6e8c2f |
@@ -102,11 +102,17 @@ class GCTests(unittest.TestCase):
|
|
|
6e8c2f |
del a
|
|
|
6e8c2f |
self.assertNotEqual(gc.collect(), 0)
|
|
|
6e8c2f |
del B, C
|
|
|
6e8c2f |
- self.assertNotEqual(gc.collect(), 0)
|
|
|
6e8c2f |
+ if hasattr(sys, 'getcounts'):
|
|
|
6e8c2f |
+ self.assertEqual(gc.collect(), 0)
|
|
|
6e8c2f |
+ else:
|
|
|
6e8c2f |
+ self.assertNotEqual(gc.collect(), 0)
|
|
|
6e8c2f |
A.a = A()
|
|
|
6e8c2f |
del A
|
|
|
6e8c2f |
- self.assertNotEqual(gc.collect(), 0)
|
|
|
6e8c2f |
- self.assertEqual(gc.collect(), 0)
|
|
|
6e8c2f |
+ if hasattr(sys, 'getcounts'):
|
|
|
6e8c2f |
+ self.assertEqual(gc.collect(), 0)
|
|
|
6e8c2f |
+ else:
|
|
|
6e8c2f |
+ self.assertNotEqual(gc.collect(), 0)
|
|
|
6e8c2f |
+ self.assertEqual(gc.collect(), 0)
|
|
|
6e8c2f |
|
|
|
6e8c2f |
def test_method(self):
|
|
|
6e8c2f |
# Tricky: self.__init__ is a bound method, it references the instance.
|