summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_collections.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r--Lib/test/test_collections.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 931ac0f..097aa9a 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -2055,6 +2055,18 @@ class CPythonOrderedDictTests(OrderedDictTests, unittest.TestCase):
with self.assertRaises(KeyError):
od.copy()
+ def test_issue24348(self):
+ OrderedDict = self.module.OrderedDict
+
+ class Key:
+ def __hash__(self):
+ return 1
+
+ od = OrderedDict()
+ od[Key()] = 0
+ # This should not crash.
+ od.popitem()
+
class PurePythonGeneralMappingTests(mapping_tests.BasicTestMappingProtocol):