From: Barry Warsaw Date: Tue, 20 Jan 2004 21:22:59 +0000 (+0000) Subject: grp_getgrgid(), grp_getgrnam(): Patch # 868499, improvement to the error X-Git-Tag: v2.3.4c1~153 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3668d888c9f12b56cdebee557edf123605521a25;p=thirdparty%2FPython%2Fcpython.git grp_getgrgid(), grp_getgrnam(): Patch # 868499, improvement to the error messages. --- diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c index ab9d3c5edd8c..136dca01b7ec 100644 --- a/Modules/grpmodule.c +++ b/Modules/grpmodule.c @@ -90,7 +90,7 @@ grp_getgrgid(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "i:getgrgid", &gid)) return NULL; if ((p = getgrgid(gid)) == NULL) { - PyErr_SetString(PyExc_KeyError, "getgrgid(): gid not found"); + PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %d", gid); return NULL; } return mkgrent(p); @@ -104,7 +104,7 @@ grp_getgrnam(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "s:getgrnam", &name)) return NULL; if ((p = getgrnam(name)) == NULL) { - PyErr_SetString(PyExc_KeyError, "getgrnam(): name not found"); + PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %s", name); return NULL; } return mkgrent(p);