An interpreted, interactive, object-oriented programming language
CentOS Sources
2017-08-01 71084d584ff953f5463757ec6536406320560b4d
commit | author | age
6e8c2f 1 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
CB 2 --- Python-2.7.2/Lib/test/test_gc.py.fix-test_gc_with_COUNT_ALLOCS    2011-09-08 19:49:13.045924309 -0400
3 +++ Python-2.7.2/Lib/test/test_gc.py    2011-09-08 19:50:07.035920617 -0400
4 @@ -102,11 +102,17 @@ class GCTests(unittest.TestCase):
5          del a
6          self.assertNotEqual(gc.collect(), 0)
7          del B, C
8 -        self.assertNotEqual(gc.collect(), 0)
9 +        if hasattr(sys, 'getcounts'):
10 +            self.assertEqual(gc.collect(), 0)
11 +        else:
12 +            self.assertNotEqual(gc.collect(), 0)
13          A.a = A()
14          del A
15 -        self.assertNotEqual(gc.collect(), 0)
16 -        self.assertEqual(gc.collect(), 0)
17 +        if hasattr(sys, 'getcounts'):
18 +            self.assertEqual(gc.collect(), 0)
19 +        else:
20 +            self.assertNotEqual(gc.collect(), 0)
21 +            self.assertEqual(gc.collect(), 0)
22  
23      def test_method(self):
24          # Tricky: self.__init__ is a bound method, it references the instance.