summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2010-10-30 08:14:53 (GMT)
committerRaymond Hettinger <python@rcn.com>2010-10-30 08:14:53 (GMT)
commit7529afce3c8e0e012738c5671d583beb3b85e270 (patch)
treed57cad231d6b3e17026f746020dc9b10b2e8a702 /Objects/dictobject.c
parent6acd432457447973edcfe39550b9ee4fc52d3a27 (diff)
downloadcpython-7529afce3c8e0e012738c5671d583beb3b85e270.zip
cpython-7529afce3c8e0e012738c5671d583beb3b85e270.tar.gz
cpython-7529afce3c8e0e012738c5671d583beb3b85e270.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 8d0e6a4..9c17be7 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -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) ||