mirror of
https://github.com/python/cpython.git
synced 2025-07-27 21:24:32 +00:00
Convert more modules to METH_VARARGS.
This commit is contained in:
parent
96a8c3954c
commit
bf92f46572
8 changed files with 139 additions and 113 deletions
|
@ -1073,12 +1073,10 @@ marshal_dump(PyObject *self, PyObject *args)
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
marshal_load(PyObject *self, PyObject *args)
|
||||
marshal_load(PyObject *self, PyObject *f)
|
||||
{
|
||||
RFILE rf;
|
||||
PyObject *f, *result;
|
||||
if (!PyArg_ParseTuple(args, "O:load", &f))
|
||||
return NULL;
|
||||
PyObject *result;
|
||||
if (!PyFile_Check(f)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"marshal.load() arg must be file");
|
||||
|
@ -1121,7 +1119,7 @@ marshal_loads(PyObject *self, PyObject *args)
|
|||
|
||||
static PyMethodDef marshal_methods[] = {
|
||||
{"dump", marshal_dump, METH_VARARGS},
|
||||
{"load", marshal_load, METH_VARARGS},
|
||||
{"load", marshal_load, METH_O},
|
||||
{"dumps", marshal_dumps, METH_VARARGS},
|
||||
{"loads", marshal_loads, METH_VARARGS},
|
||||
{NULL, NULL} /* sentinel */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue