mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Fix _PyDict_Pop() on pending key
Issue #28120: Fix dict.pop() for splitted dictionary when trying to remove a "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang.
This commit is contained in:
parent
9926480b6a
commit
d0ad11f6b4
3 changed files with 13 additions and 1 deletions
|
@ -1721,7 +1721,7 @@ _PyDict_Pop(PyDictObject *mp, PyObject *key, PyObject *deflt)
|
|||
ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, &hashpos);
|
||||
if (ix == DKIX_ERROR)
|
||||
return NULL;
|
||||
if (ix == DKIX_EMPTY) {
|
||||
if (ix == DKIX_EMPTY || *value_addr == NULL) {
|
||||
if (deflt) {
|
||||
Py_INCREF(deflt);
|
||||
return deflt;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue