diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2002-04-02 18:17:57 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2002-04-02 18:17:57 (GMT) |
commit | 187ae561667f82142edbe7beaa612381b6bb0827 (patch) | |
tree | 1d2e0fba61e51cbbddee5f7370c283ecbf137c3c /Modules/stropmodule.c | |
parent | 155db9aa222e96fcaf2db4d80b414098889a7c5d (diff) | |
download | cpython-187ae561667f82142edbe7beaa612381b6bb0827.zip cpython-187ae561667f82142edbe7beaa612381b6bb0827.tar.gz cpython-187ae561667f82142edbe7beaa612381b6bb0827.tar.bz2 |
Get rid of more PyArg_Parse & METH_OLDARGS.
PyArg_Parse( "s" ) -> PyString_AsString
PyArg_Parse( "t#" ) -> PyString_AsStringAndSize
Diffstat (limited to 'Modules/stropmodule.c')
-rw-r--r-- | Modules/stropmodule.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Modules/stropmodule.c b/Modules/stropmodule.c index 9af9312..0d5b75c 100644 --- a/Modules/stropmodule.c +++ b/Modules/stropmodule.c @@ -376,7 +376,7 @@ do_strip(PyObject *args, int striptype) int len, i, j; - if (!PyArg_Parse(args, "t#", &s, &len)) + if (PyString_AsStringAndSize(args, &s, &len)) return NULL; i = 0; @@ -457,7 +457,7 @@ strop_lower(PyObject *self, PyObject *args) int changed; WARN; - if (!PyArg_Parse(args, "t#", &s, &n)) + if (PyString_AsStringAndSize(args, &s, &n)) return NULL; new = PyString_FromStringAndSize(NULL, n); if (new == NULL) @@ -496,7 +496,7 @@ strop_upper(PyObject *self, PyObject *args) int changed; WARN; - if (!PyArg_Parse(args, "t#", &s, &n)) + if (PyString_AsStringAndSize(args, &s, &n)) return NULL; new = PyString_FromStringAndSize(NULL, n); if (new == NULL) @@ -536,7 +536,7 @@ strop_capitalize(PyObject *self, PyObject *args) int changed; WARN; - if (!PyArg_Parse(args, "t#", &s, &n)) + if (PyString_AsStringAndSize(args, &s, &n)) return NULL; new = PyString_FromStringAndSize(NULL, n); if (new == NULL) @@ -702,7 +702,7 @@ strop_swapcase(PyObject *self, PyObject *args) int changed; WARN; - if (!PyArg_Parse(args, "t#", &s, &n)) + if (PyString_AsStringAndSize(args, &s, &n)) return NULL; new = PyString_FromStringAndSize(NULL, n); if (new == NULL) @@ -1190,24 +1190,24 @@ strop_methods[] = { {"atof", strop_atof, METH_VARARGS, atof__doc__}, {"atoi", strop_atoi, METH_VARARGS, atoi__doc__}, {"atol", strop_atol, METH_VARARGS, atol__doc__}, - {"capitalize", strop_capitalize, METH_OLDARGS, capitalize__doc__}, + {"capitalize", strop_capitalize, METH_O, capitalize__doc__}, {"count", strop_count, METH_VARARGS, count__doc__}, {"expandtabs", strop_expandtabs, METH_VARARGS, expandtabs__doc__}, {"find", strop_find, METH_VARARGS, find__doc__}, {"join", strop_joinfields, METH_VARARGS, joinfields__doc__}, {"joinfields", strop_joinfields, METH_VARARGS, joinfields__doc__}, - {"lstrip", strop_lstrip, METH_OLDARGS, lstrip__doc__}, - {"lower", strop_lower, METH_OLDARGS, lower__doc__}, + {"lstrip", strop_lstrip, METH_O, lstrip__doc__}, + {"lower", strop_lower, METH_O, lower__doc__}, {"maketrans", strop_maketrans, METH_VARARGS, maketrans__doc__}, {"replace", strop_replace, METH_VARARGS, replace__doc__}, {"rfind", strop_rfind, METH_VARARGS, rfind__doc__}, - {"rstrip", strop_rstrip, METH_OLDARGS, rstrip__doc__}, + {"rstrip", strop_rstrip, METH_O, rstrip__doc__}, {"split", strop_splitfields, METH_VARARGS, splitfields__doc__}, {"splitfields", strop_splitfields, METH_VARARGS, splitfields__doc__}, - {"strip", strop_strip, METH_OLDARGS, strip__doc__}, - {"swapcase", strop_swapcase, METH_OLDARGS, swapcase__doc__}, + {"strip", strop_strip, METH_O, strip__doc__}, + {"swapcase", strop_swapcase, METH_O, swapcase__doc__}, {"translate", strop_translate, METH_VARARGS, translate__doc__}, - {"upper", strop_upper, METH_OLDARGS, upper__doc__}, + {"upper", strop_upper, METH_O, upper__doc__}, {NULL, NULL} /* sentinel */ }; |