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