diff options
-rw-r--r-- | Modules/zlibmodule.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index ff34706..9416528 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -610,7 +610,7 @@ PyZlib_unflush(compobject *self, PyObject *args) int length=0, err; PyObject *RetVal; - if (!PyArg_NoArgs(args)) + if (!PyArg_ParseTuple(args, "")) return NULL; if (!(RetVal = PyString_FromStringAndSize(NULL, DEFAULTALLOC))) { @@ -675,15 +675,19 @@ PyZlib_unflush(compobject *self, PyObject *args) static PyMethodDef comp_methods[] = { - {"compress", (binaryfunc)PyZlib_objcompress, 1, comp_compress__doc__}, - {"flush", (binaryfunc)PyZlib_flush, 1, comp_flush__doc__}, + {"compress", (binaryfunc)PyZlib_objcompress, + METH_VARARGS, comp_compress__doc__}, + {"flush", (binaryfunc)PyZlib_flush, + METH_VARARGS, comp_flush__doc__}, {NULL, NULL} }; static PyMethodDef Decomp_methods[] = { - {"decompress", (binaryfunc)PyZlib_objdecompress, 1, decomp_decompress__doc__}, - {"flush", (binaryfunc)PyZlib_unflush, 0, decomp_flush__doc__}, + {"decompress", (binaryfunc)PyZlib_objdecompress, + METH_VARARGS, decomp_decompress__doc__}, + {"flush", (binaryfunc)PyZlib_unflush, + METH_VARARGS, decomp_flush__doc__}, {NULL, NULL} }; @@ -750,13 +754,19 @@ PyZlib_crc32(PyObject *self, PyObject *args) static PyMethodDef zlib_methods[] = { - {"adler32", (PyCFunction)PyZlib_adler32, 1, adler32__doc__}, - {"compress", (PyCFunction)PyZlib_compress, 1, compress__doc__}, - {"compressobj", (PyCFunction)PyZlib_compressobj, 1, compressobj__doc__}, - {"crc32", (PyCFunction)PyZlib_crc32, 1, crc32__doc__}, - {"decompress", (PyCFunction)PyZlib_decompress, 1, decompress__doc__}, - {"decompressobj", (PyCFunction)PyZlib_decompressobj, 1, decompressobj__doc__}, - {NULL, NULL} + {"adler32", (PyCFunction)PyZlib_adler32, + METH_VARARGS, adler32__doc__}, + {"compress", (PyCFunction)PyZlib_compress, + METH_VARARGS, compress__doc__}, + {"compressobj", (PyCFunction)PyZlib_compressobj, + METH_VARARGS, compressobj__doc__}, + {"crc32", (PyCFunction)PyZlib_crc32, + METH_VARARGS, crc32__doc__}, + {"decompress", (PyCFunction)PyZlib_decompress, + METH_VARARGS, decompress__doc__}, + {"decompressobj", (PyCFunction)PyZlib_decompressobj, + METH_VARARGS, decompressobj__doc__}, + {NULL, NULL} }; statichere PyTypeObject Comptype = { |