summaryrefslogtreecommitdiffstats
path: root/Modules/regexmodule.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/regexmodule.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/regexmodule.c')
-rw-r--r--Modules/regexmodule.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/Modules/regexmodule.c b/Modules/regexmodule.c
index e65258d..d449604 100644
--- a/Modules/regexmodule.c
+++ b/Modules/regexmodule.c
@@ -583,7 +583,7 @@ regex_match(PyObject *self, PyObject *args)
PyObject *pat, *string;
PyObject *tuple, *v;
- if (!PyArg_Parse(args, "(SS)", &pat, &string))
+ if (!PyArg_ParseTuple(args, "SS:match", &pat, &string))
return NULL;
if (update_cache(pat) < 0)
return NULL;
@@ -601,7 +601,7 @@ regex_search(PyObject *self, PyObject *args)
PyObject *pat, *string;
PyObject *tuple, *v;
- if (!PyArg_Parse(args, "(SS)", &pat, &string))
+ if (!PyArg_ParseTuple(args, "SS:search", &pat, &string))
return NULL;
if (update_cache(pat) < 0)
return NULL;
@@ -617,7 +617,7 @@ static PyObject *
regex_set_syntax(PyObject *self, PyObject *args)
{
int syntax;
- if (!PyArg_Parse(args, "i", &syntax))
+ if (!PyArg_ParseTuple(args, "i:set_syntax", &syntax))
return NULL;
syntax = re_set_syntax(syntax);
/* wipe the global pattern cache */
@@ -629,10 +629,8 @@ regex_set_syntax(PyObject *self, PyObject *args)
}
static PyObject *
-regex_get_syntax(PyObject *self, PyObject *args)
+regex_get_syntax(PyObject *self)
{
- if (!PyArg_Parse(args, ""))
- return NULL;
return PyInt_FromLong((long)re_syntax);
}
@@ -640,10 +638,10 @@ regex_get_syntax(PyObject *self, PyObject *args)
static struct PyMethodDef regex_global_methods[] = {
{"compile", regex_compile, METH_VARARGS},
{"symcomp", regex_symcomp, METH_VARARGS},
- {"match", regex_match, METH_OLDARGS},
- {"search", regex_search, METH_OLDARGS},
- {"set_syntax", regex_set_syntax, METH_OLDARGS},
- {"get_syntax", regex_get_syntax, METH_OLDARGS},
+ {"match", regex_match, METH_VARARGS},
+ {"search", regex_search, METH_VARARGS},
+ {"set_syntax", regex_set_syntax, METH_VARARGS},
+ {"get_syntax", (PyCFunction)regex_get_syntax, METH_NOARGS},
{NULL, NULL} /* sentinel */
};