Commit fc64bb42 authored by Barry Warsaw's avatar Barry Warsaw

grp_getgrgid(), grp_getgrnam(): Patch # 868499, improvement to the error

messages.
parent 76e13c80
...@@ -90,7 +90,7 @@ grp_getgrgid(PyObject *self, PyObject *args) ...@@ -90,7 +90,7 @@ grp_getgrgid(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "i:getgrgid", &gid)) if (!PyArg_ParseTuple(args, "i:getgrgid", &gid))
return NULL; return NULL;
if ((p = getgrgid(gid)) == 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 NULL;
} }
return mkgrent(p); return mkgrent(p);
...@@ -104,7 +104,7 @@ grp_getgrnam(PyObject *self, PyObject *args) ...@@ -104,7 +104,7 @@ grp_getgrnam(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s:getgrnam", &name)) if (!PyArg_ParseTuple(args, "s:getgrnam", &name))
return NULL; return NULL;
if ((p = getgrnam(name)) == 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 NULL;
} }
return mkgrent(p); return mkgrent(p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment