mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Merge 3.6 (issue #28544)
This commit is contained in:
commit
f0bbee6228
3 changed files with 12 additions and 8 deletions
|
@ -1769,13 +1769,17 @@ PyDict_Next(PyObject *op, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
|
|||
|
||||
/* Internal version of dict.pop(). */
|
||||
PyObject *
|
||||
_PyDict_Pop(PyDictObject *mp, PyObject *key, PyObject *deflt)
|
||||
_PyDict_Pop(PyObject *dict, PyObject *key, PyObject *deflt)
|
||||
{
|
||||
Py_hash_t hash;
|
||||
Py_ssize_t ix, hashpos;
|
||||
PyObject *old_value, *old_key;
|
||||
PyDictKeyEntry *ep;
|
||||
PyObject **value_addr;
|
||||
PyDictObject *mp;
|
||||
|
||||
assert(PyDict_Check(dict));
|
||||
mp = (PyDictObject *)dict;
|
||||
|
||||
if (mp->ma_used == 0) {
|
||||
if (deflt) {
|
||||
|
@ -2837,7 +2841,7 @@ dict_pop(PyDictObject *mp, PyObject *args)
|
|||
if(!PyArg_UnpackTuple(args, "pop", 1, 2, &key, &deflt))
|
||||
return NULL;
|
||||
|
||||
return _PyDict_Pop(mp, key, deflt);
|
||||
return _PyDict_Pop((PyObject*)mp, key, deflt);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue