Issue #24348: Drop superfluous increfs/decrefs.

This commit is contained in:
Eric Snow 2015-06-01 23:12:13 -06:00
parent a762af74b2
commit d171975609
3 changed files with 27 additions and 33 deletions

View file

@ -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):