diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2015-06-02 05:12:13 (GMT) |
---|---|---|
committer | Eric Snow <ericsnowcurrently@gmail.com> | 2015-06-02 05:12:13 (GMT) |
commit | d1719756098b282ad703b899ebcb57eeeb0167c2 (patch) | |
tree | 016b19f3fb7ce50e8fc473c8d7b90a075889b548 /Lib | |
parent | a762af74b2de734c44f7dc00358325d4485e2530 (diff) | |
download | cpython-d1719756098b282ad703b899ebcb57eeeb0167c2.zip cpython-d1719756098b282ad703b899ebcb57eeeb0167c2.tar.gz cpython-d1719756098b282ad703b899ebcb57eeeb0167c2.tar.bz2 |
Issue #24348: Drop superfluous increfs/decrefs.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_collections.py | 12 |
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): |