summaryrefslogtreecommitdiffstats
path: root/00135-fix-test-within-test_weakref-in-debug-build.patch
blob: 6ed780187079411bcfc364b0f1da6c1c5537420c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff -up Python-3.2b2/Lib/test/test_weakref.py.test-weakref-COUNT_ALLOCS_fix Python-3.2b2/Lib/test/test_weakref.py
--- Python-3.2b2/Lib/test/test_weakref.py.test-weakref-COUNT_ALLOCS_fix	2010-12-28 20:33:46.963364990 -0500
+++ Python-3.2b2/Lib/test/test_weakref.py	2010-12-28 20:35:44.115935248 -0500
@@ -583,9 +583,10 @@ class ReferencesTestCase(TestBase):
         # been cleared without their callbacks executing.  OTOH, the weakref
         # to C is bound to a function local (wr), and wasn't trash, so that
         # callback should have been invoked when C went away.
-        self.assertEqual(alist, ["C went away"])
-        # The remaining weakref should be dead now (its callback ran).
-        self.assertEqual(wr(), None)
+        if not hasattr(sys, 'getcounts'):
+            self.assertEqual(alist, ["C went away"])
+            # The remaining weakref should be dead now (its callback ran).
+            self.assertEqual(wr(), None)
 
         del alist[:]
         gc.collect()