diff options
author | Raymond Hettinger <python@rcn.com> | 2010-10-30 08:10:29 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-10-30 08:10:29 (GMT) |
commit | dd4215483f369f17e15804179212493c76b7bc41 (patch) | |
tree | c95c589f9f2296fc8e3b6494f66f374cfbf320ba /Objects/dictobject.c | |
parent | 6b6dffdc73848aa05045b50fe4102216622a286e (diff) | |
download | cpython-dd4215483f369f17e15804179212493c76b7bc41.zip cpython-dd4215483f369f17e15804179212493c76b7bc41.tar.gz cpython-dd4215483f369f17e15804179212493c76b7bc41.tar.bz2 |
Issue 10221: Improve error message for dict.pop().
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r-- | Objects/dictobject.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index d932ba7..1015772 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -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) || |