summaryrefslogtreecommitdiff
path: root/Modules/nismodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-03-31 15:27:00 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2002-03-31 15:27:00 +0000
commit81bea7c04c588b2dfcd68810dcdd0d3ed4d10e64 (patch)
tree0c20df62499c29cddcd34b14fd9c6cd588a0daf9 /Modules/nismodule.c
parent467d11d4c82d7a79c8388a3ea7c025c02f4dc572 (diff)
downloadcpython-81bea7c04c588b2dfcd68810dcdd0d3ed4d10e64.tar.gz
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/nismodule.c')
-rw-r--r--Modules/nismodule.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/Modules/nismodule.c b/Modules/nismodule.c
index f8a92464c6..f66e9a1cc6 100644
--- a/Modules/nismodule.c
+++ b/Modules/nismodule.c
@@ -120,7 +120,7 @@ nis_match (PyObject *self, PyObject *args)
PyObject *res;
int fix;
- if (!PyArg_Parse(args, "(t#s)", &key, &keylen, &map))
+ if (!PyArg_ParseTuple(args, "t#s:match", &key, &keylen, &map))
return NULL;
if ((err = yp_get_default_domain(&domain)) != 0)
return nis_error(err);
@@ -149,7 +149,7 @@ nis_cat (PyObject *self, PyObject *args)
PyObject *dict;
int err;
- if (!PyArg_Parse(args, "s", &map))
+ if (!PyArg_ParseTuple(args, "s:cat", &map))
return NULL;
if ((err = yp_get_default_domain(&domain)) != 0)
return nis_error(err);
@@ -338,13 +338,11 @@ nis_maplist (void)
}
static PyObject *
-nis_maps (PyObject *self, PyObject *args)
+nis_maps (PyObject *self)
{
nismaplist *maps;
PyObject *list;
- if (!PyArg_NoArgs(args))
- return NULL;
if ((maps = nis_maplist ()) == NULL)
return NULL;
if ((list = PyList_New(0)) == NULL)
@@ -364,9 +362,9 @@ nis_maps (PyObject *self, PyObject *args)
}
static PyMethodDef nis_methods[] = {
- {"match", nis_match, METH_OLDARGS},
- {"cat", nis_cat, METH_OLDARGS},
- {"maps", nis_maps, METH_OLDARGS},
+ {"match", nis_match, METH_VARARGS},
+ {"cat", nis_cat, METH_VARARGS},
+ {"maps", (PyCFunction)nis_maps, METH_NOARGS},
{NULL, NULL} /* Sentinel */
};