summaryrefslogtreecommitdiff
path: root/Modules/pwdmodule.c
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2004-01-20 21:07:23 +0000
committerBarry Warsaw <barry@python.org>2004-01-20 21:07:23 +0000
commitfb14d5431d5078d098fa8df816eb68733a07669e (patch)
tree07c9639ecf54e3af9bd3c97c1db839bc2e921ef4 /Modules/pwdmodule.c
parentfc64bb4281839f1324b3bfb5355b5d5c48b999d9 (diff)
downloadcpython-fb14d5431d5078d098fa8df816eb68733a07669e.tar.gz
pwd_getpwuid(), pwd_getpwnam(): Patch # 868499, improvement to the error
messages.
Diffstat (limited to 'Modules/pwdmodule.c')
-rw-r--r--Modules/pwdmodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
index 6bbea33c38..805d4d9a2c 100644
--- a/Modules/pwdmodule.c
+++ b/Modules/pwdmodule.c
@@ -107,7 +107,8 @@ pwd_getpwuid(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "i:getpwuid", &uid))
return NULL;
if ((p = getpwuid(uid)) == NULL) {
- PyErr_SetString(PyExc_KeyError, "getpwuid(): uid not found");
+ PyErr_Format(PyExc_KeyError,
+ "getpwuid(): uid not found: %d", uid);
return NULL;
}
return mkpwent(p);
@@ -127,7 +128,8 @@ pwd_getpwnam(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s:getpwnam", &name))
return NULL;
if ((p = getpwnam(name)) == NULL) {
- PyErr_SetString(PyExc_KeyError, "getpwnam(): name not found");
+ PyErr_Format(PyExc_KeyError,
+ "getpwnam(): name not found: %s", name);
return NULL;
}
return mkpwent(p);