]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
pwd_getpwuid(), pwd_getpwnam(): Patch # 868499, improvement to the error
authorBarry Warsaw <barry@python.org>
Tue, 20 Jan 2004 21:23:46 +0000 (21:23 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 20 Jan 2004 21:23:46 +0000 (21:23 +0000)
messages.

Modules/pwdmodule.c

index 7e3c3ae170ae88e212aab1d1a0f7e900cd9d8fb3..a135ae7f9705804d7ef148e47cf3d2dbd47bbc45 100644 (file)
@@ -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);