]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - python/patches/python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
python: Update to 2.7.5.
[people/ms/ipfire-3.x.git] / python / patches / python-2.7.1-fix_test_abc_with_COUNT_ALLOCS.patch
CommitLineData
48d9a6a0
MT
1diff -up Python-2.7.1/Lib/test/test_abc.py.cache_leak Python-2.7.1/Lib/test/test_abc.py
2--- Python-2.7.1/Lib/test/test_abc.py.cache_leak 2010-12-28 18:06:35.551938356 -0500
3+++ Python-2.7.1/Lib/test/test_abc.py 2010-12-28 18:09:09.021059202 -0500
4@@ -3,6 +3,8 @@
5
6 """Unit tests for abc.py."""
7
8+import sys
9+
10 import unittest, weakref
11 from test import test_support
12
13@@ -229,8 +231,12 @@ class TestABC(unittest.TestCase):
14 # Trigger cache.
15 C().f()
16 del C
17- test_support.gc_collect()
18- self.assertEqual(r(), None)
19+ # This doesn't work in our debug build, presumably due to its use
20+ # of COUNT_ALLOCS, which makes heap-allocated types immortal (once
21+ # they've ever had an instance):
22+ if not hasattr(sys, 'getcounts'):
23+ test_support.gc_collect()
24+ self.assertEqual(r(), None)
25
26 def test_main():
27 test_support.run_unittest(TestABC)