summaryrefslogtreecommitdiffstats
path: root/Modules/nismodule.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-03-31 15:27:00 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-03-31 15:27:00 (GMT)
commitba3a16c6c3d3da0903873e9464dbc540eaeda1f7 (patch)
tree6094d419dcf56dfdb9bdb50da0a15d0c0160573a /Modules/nismodule.c
parent50905b557b2a46d4db432b7a9e61fe32afa557e3 (diff)
downloadcpython-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/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 f8a9246..f66e9a1 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 */
};