diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-03-31 15:27:00 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-03-31 15:27:00 (GMT) |
commit | ba3a16c6c3d3da0903873e9464dbc540eaeda1f7 (patch) | |
tree | 6094d419dcf56dfdb9bdb50da0a15d0c0160573a /Modules/pwdmodule.c | |
parent | 50905b557b2a46d4db432b7a9e61fe32afa557e3 (diff) | |
download | cpython-ba3a16c6c3d3da0903873e9464dbc540eaeda1f7.zip cpython-ba3a16c6c3d3da0903873e9464dbc540eaeda1f7.tar.gz cpython-ba3a16c6c3d3da0903873e9464dbc540eaeda1f7.tar.bz2 |
Remove METH_OLDARGS:
Convert METH_OLDARGS -> METH_VARARGS: also PyArg_Parse -> PyArg_ParseTuple
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Please review. All tests pass, but some modules don't have tests.
I spot checked various functions to try to make sure nothing broke.
Diffstat (limited to 'Modules/pwdmodule.c')
-rw-r--r-- | Modules/pwdmodule.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c index 08c86d5..9656bba 100644 --- a/Modules/pwdmodule.c +++ b/Modules/pwdmodule.c @@ -84,7 +84,7 @@ pwd_getpwuid(PyObject *self, PyObject *args) { int uid; struct passwd *p; - if (!PyArg_Parse(args, "i", &uid)) + if (!PyArg_ParseTuple(args, "i:getpwuid", &uid)) return NULL; if ((p = getpwuid(uid)) == NULL) { PyErr_SetString(PyExc_KeyError, "getpwuid(): uid not found"); @@ -103,7 +103,7 @@ pwd_getpwnam(PyObject *self, PyObject *args) { char *name; struct passwd *p; - if (!PyArg_Parse(args, "s", &name)) + if (!PyArg_ParseTuple(args, "s:getpwnam", &name)) return NULL; if ((p = getpwnam(name)) == NULL) { PyErr_SetString(PyExc_KeyError, "getpwnam(): name not found"); @@ -146,8 +146,8 @@ pwd_getpwall(PyObject *self) #endif static PyMethodDef pwd_methods[] = { - {"getpwuid", pwd_getpwuid, METH_OLDARGS, pwd_getpwuid__doc__}, - {"getpwnam", pwd_getpwnam, METH_OLDARGS, pwd_getpwnam__doc__}, + {"getpwuid", pwd_getpwuid, METH_VARARGS, pwd_getpwuid__doc__}, + {"getpwnam", pwd_getpwnam, METH_VARARGS, pwd_getpwnam__doc__}, #ifdef HAVE_GETPWENT {"getpwall", (PyCFunction)pwd_getpwall, METH_NOARGS, pwd_getpwall__doc__}, |