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