mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Issue #24348: Drop superfluous increfs/decrefs.
This commit is contained in:
parent
a762af74b2
commit
d171975609
3 changed files with 27 additions and 33 deletions
|
|
@ -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):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue