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