Issue 10221: Improve error message for dict.pop().

This commit is contained in:
Raymond Hettinger 2010-10-30 08:14:53 +00:00
parent 6acd432457
commit 7529afce3c
2 changed files with 4 additions and 2 deletions

View file

@ -1810,8 +1810,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) ||