summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-08-11 09:07:59 +0000
committerGeorg Brandl <georg@python.org>2008-08-11 09:07:59 +0000
commit1e13ea94a3da9fa2b60c24ff201c5ae69791572d (patch)
treeb5e06ec816e047ea89c5dcd6ad5575d16c2141d0 /Lib/test
parent14646337bff978f5eba7f2add21ffbe89e894c7c (diff)
downloadcpython-git-1e13ea94a3da9fa2b60c24ff201c5ae69791572d.tar.gz
- Issue #3537: Fix an assertion failure when an empty but presized dict
object was stored in the freelist.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_dict.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index b62237d9d6..f715657d36 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -544,6 +544,17 @@ class DictTest(unittest.TestCase):
resizing = True
d[9] = 6
+ def test_empty_presized_dict_in_freelist(self):
+ # Bug #3537: if an empty but presized dict with a size larger
+ # than 7 was in the freelist, it triggered an assertion failure
+ try:
+ d = {'a': 1/0, 'b': None, 'c': None, 'd': None, 'e': None,
+ 'f': None, 'g': None, 'h': None}
+ except ZeroDivisionError:
+ pass
+ d = {}
+
+
from test import mapping_tests