diff options
author | Georg Brandl <georg@python.org> | 2006-05-29 21:04:52 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-05-29 21:04:52 (GMT) |
commit | 96a8c3954cbdb186bc567a490dad8987508ce268 (patch) | |
tree | 4d6516790abcd566c43418e4c9b02e9c52cf9f2f /Modules/posixmodule.c | |
parent | fd9a4b19e9c77e9ccc3e7fcb57051cf160c0df6d (diff) | |
download | cpython-96a8c3954cbdb186bc567a490dad8987508ce268.zip cpython-96a8c3954cbdb186bc567a490dad8987508ce268.tar.gz cpython-96a8c3954cbdb186bc567a490dad8987508ce268.tar.bz2 |
Make use of METH_O and METH_NOARGS where possible.
Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 7f0a261..c0280de 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -5282,14 +5282,11 @@ PyDoc_STRVAR(posix_setgroups__doc__, Set the groups of the current process to list."); static PyObject * -posix_setgroups(PyObject *self, PyObject *args) +posix_setgroups(PyObject *self, PyObject *groups) { - PyObject *groups; int i, len; gid_t grouplist[MAX_GROUPS]; - if (!PyArg_ParseTuple(args, "O:setgid", &groups)) - return NULL; if (!PySequence_Check(groups)) { PyErr_SetString(PyExc_TypeError, "setgroups argument must be a sequence"); return NULL; @@ -8020,7 +8017,7 @@ static PyMethodDef posix_methods[] = { {"setgid", posix_setgid, METH_VARARGS, posix_setgid__doc__}, #endif /* HAVE_SETGID */ #ifdef HAVE_SETGROUPS - {"setgroups", posix_setgroups, METH_VARARGS, posix_setgroups__doc__}, + {"setgroups", posix_setgroups, METH_O, posix_setgroups__doc__}, #endif /* HAVE_SETGROUPS */ #ifdef HAVE_GETPGID {"getpgid", posix_getpgid, METH_VARARGS, posix_getpgid__doc__}, |