diff options
author | Barry Warsaw <barry@python.org> | 2004-01-20 21:07:23 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2004-01-20 21:07:23 (GMT) |
commit | e1b1c8763625b8906313c4d10d4135b46d2a4ccd (patch) | |
tree | 8e239ef4cb105e22124147906b66fba915e617e3 /Modules | |
parent | c7a770932156c80ad462a6c72f7cb70f10ea9417 (diff) | |
download | cpython-e1b1c8763625b8906313c4d10d4135b46d2a4ccd.zip cpython-e1b1c8763625b8906313c4d10d4135b46d2a4ccd.tar.gz cpython-e1b1c8763625b8906313c4d10d4135b46d2a4ccd.tar.bz2 |
pwd_getpwuid(), pwd_getpwnam(): Patch # 868499, improvement to the error
messages.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/pwdmodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c index 6bbea33..805d4d9 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); |