From: zooko Date: Tue, 20 May 2008 22:51:29 +0000 (+0530) Subject: give names to C functions for use in reporting exceptions about which function receiv... X-Git-Url: https://git.rkrishnan.org/pf/content/en/seg/simplejson/install-details.html?a=commitdiff_plain;h=fe12055578144fec18deac40552f0ec7c51da186;p=tahoe-lafs%2Fzfec.git give names to C functions for use in reporting exceptions about which function received incorrect arguments darcs-hash:c45702607f53072ae9cff92e1f2b58d57617aaea --- diff --git a/zfec/zfec/_fecmodule.c b/zfec/zfec/_fecmodule.c index d42e635..eea1b40 100644 --- a/zfec/zfec/_fecmodule.c +++ b/zfec/zfec/_fecmodule.c @@ -58,7 +58,7 @@ Encoder_init(Encoder *self, PyObject *args, PyObject *kwdict) { NULL }; int ink, inm; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "ii", kwlist, &ink, &inm)) + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "ii:Encoder.__init__", kwlist, &ink, &inm)) return -1; if (ink < 1) { @@ -113,7 +113,7 @@ Encoder_encode(Encoder *self, PyObject *args) { Py_ssize_t sz, oldsz = 0; unsigned char check_block_index = 0; /* index into the check_blocks_produced and (parallel) pystrs_produced arrays */ - if (!PyArg_ParseTuple(args, "O|O", &inblocks, &desired_blocks_nums)) + if (!PyArg_ParseTuple(args, "O|O:Encoder.encode", &inblocks, &desired_blocks_nums)) return NULL; for (i=0; imm - self->kk; i++) @@ -317,7 +317,7 @@ Decoder_init(Encoder *self, PyObject *args, PyObject *kwdict) { }; int ink, inm; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "ii", kwlist, &ink, &inm)) + if (!PyArg_ParseTupleAndKeywords(args, kwdict, "ii:Decoder.__init__", kwlist, &ink, &inm)) return -1; if (ink < 1) { @@ -373,7 +373,7 @@ Decoder_decode(Decoder *self, PyObject *args) { long tmpl; unsigned nextrecoveredix=0; - if (!PyArg_ParseTuple(args, "OO", &blocks, &blocknums)) + if (!PyArg_ParseTuple(args, "OO:Decoder.decode", &blocks, &blocknums)) return NULL; for (i=0; ikk; i++)