]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-141510: Raise TypeError in PyDict_SetItem() on frozendict (#145564)
authorVictor Stinner <vstinner@python.org>
Wed, 11 Mar 2026 16:05:09 +0000 (17:05 +0100)
committerGitHub <noreply@github.com>
Wed, 11 Mar 2026 16:05:09 +0000 (17:05 +0100)
commit713be70175a2dad477a1cf5e7c00bab0edda04ad
treefc0f318c42e2d8cbb6c2367b1b9d4b07ba7fe042
parent706fd4ec08acbf1b1def3630017ebe55d224adfa
gh-141510: Raise TypeError in PyDict_SetItem() on frozendict (#145564)

If the following functions get an unexpected frozendict,
raise TypeError instead of SystemError:

* PyDict_DelItem()
* PyDict_DelItemString()
* PyDict_Merge()
* PyDict_MergeFromSeq2()
* PyDict_Pop()
* PyDict_PopString()
* PyDict_SetDefault()
* PyDict_SetDefaultRef()
* PyDict_SetItem()
* PyDict_SetItemString()
* _PyDict_SetItem_KnownHash()
* PyDict_Update()

Co-authored-by: mohsinm-dev <mohsin.mdev@gmail.com>
Lib/test/test_capi/test_dict.py
Objects/dictobject.c