mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Issue 10221: Improve error message for dict.pop().
This commit is contained in:
parent
6b6dffdc73
commit
dd4215483f
2 changed files with 4 additions and 2 deletions
|
|
@ -1820,8 +1820,7 @@ dict_pop(PyDictObject *mp, PyObject *args)
|
|||
Py_INCREF(deflt);
|
||||
return deflt;
|
||||
}
|
||||
PyErr_SetString(PyExc_KeyError,
|
||||
"pop(): dictionary is empty");
|
||||
set_key_error(key);
|
||||
return NULL;
|
||||
}
|
||||
if (!PyUnicode_CheckExact(key) ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue