summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2010-10-30 08:17:46 (GMT)
committerRaymond Hettinger <python@rcn.com>2010-10-30 08:17:46 (GMT)
commit2ad17e19eec7f873005a215a00c13520c679d4fb (patch)
tree5afb2827106033f8bdb24c518775c6c20b0242d5 /Objects/dictobject.c
parentcbba8d4c7a5b77ef60c088b5070b919b32a1b861 (diff)
downloadcpython-2ad17e19eec7f873005a215a00c13520c679d4fb.zip
cpython-2ad17e19eec7f873005a215a00c13520c679d4fb.tar.gz
cpython-2ad17e19eec7f873005a215a00c13520c679d4fb.tar.bz2
Issue 10221: Improve error message for dict.pop().
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r--Objects/dictobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index def3da9..3670e97 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -1980,8 +1980,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 (!PyString_CheckExact(key) ||