mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
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.
This commit is contained in:
parent
50905b557b
commit
ba3a16c6c3
11 changed files with 85 additions and 164 deletions
|
@ -14,7 +14,7 @@ static PyObject *crypt_crypt(PyObject *self, PyObject *args)
|
|||
char *word, *salt;
|
||||
extern char * crypt(const char *, const char *);
|
||||
|
||||
if (!PyArg_Parse(args, "(ss)", &word, &salt)) {
|
||||
if (!PyArg_ParseTuple(args, "ss:crypt", &word, &salt)) {
|
||||
return NULL;
|
||||
}
|
||||
return PyString_FromString( crypt( word, salt ) );
|
||||
|
@ -31,7 +31,7 @@ the same alphabet as the salt.";
|
|||
|
||||
|
||||
static PyMethodDef crypt_methods[] = {
|
||||
{"crypt", crypt_crypt, METH_OLDARGS, crypt_crypt__doc__},
|
||||
{"crypt", crypt_crypt, METH_VARARGS, crypt_crypt__doc__},
|
||||
{NULL, NULL} /* sentinel */
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue