Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2efa369

Browse files
committed
Use modern PyArg_ParseTuple style, with function names.
1 parent 6a973c7 commit 2efa369

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Python/marshal.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ marshal_dump(self, args)
713713
WFILE wf;
714714
PyObject *x;
715715
PyObject *f;
716-
if (!PyArg_Parse(args, "(OO)", &x, &f))
716+
if (!PyArg_ParseTuple(args, "OO:dump", &x, &f))
717717
return NULL;
718718
if (!PyFile_Check(f)) {
719719
PyErr_SetString(PyExc_TypeError,
@@ -741,7 +741,7 @@ marshal_load(self, args)
741741
RFILE rf;
742742
PyObject *f;
743743
PyObject *v;
744-
if (!PyArg_Parse(args, "O", &f))
744+
if (!PyArg_ParseTuple(args, "O:load", &f))
745745
return NULL;
746746
if (!PyFile_Check(f)) {
747747
PyErr_SetString(PyExc_TypeError,
@@ -766,7 +766,7 @@ marshal_dumps(self, args)
766766
PyObject *args;
767767
{
768768
PyObject *x;
769-
if (!PyArg_Parse(args, "O", &x))
769+
if (!PyArg_ParseTuple(args, "O:dumps", &x))
770770
return NULL;
771771
return PyMarshal_WriteObjectToString(x);
772772
}
@@ -780,7 +780,7 @@ marshal_loads(self, args)
780780
PyObject *v;
781781
char *s;
782782
int n;
783-
if (!PyArg_Parse(args, "s#", &s, &n))
783+
if (!PyArg_ParseTuple(args, "s#:loads", &s, &n))
784784
return NULL;
785785
rf.fp = NULL;
786786
rf.str = args;
@@ -796,10 +796,10 @@ marshal_loads(self, args)
796796
}
797797

798798
static PyMethodDef marshal_methods[] = {
799-
{"dump", marshal_dump},
800-
{"load", marshal_load},
801-
{"dumps", marshal_dumps},
802-
{"loads", marshal_loads},
799+
{"dump", marshal_dump, 1},
800+
{"load", marshal_load, 1},
801+
{"dumps", marshal_dumps, 1},
802+
{"loads", marshal_loads, 1},
803803
{NULL, NULL} /* sentinel */
804804
};
805805

0 commit comments

Comments
 (0)