@@ -906,41 +906,23 @@ PyDoc_STRVAR(isal_zlib_decompressobj__doc__,
906
906
" dictionary as used by the compressor that produced the input data." );
907
907
908
908
#define ISAL_ZLIB_DECOMPRESSOBJ_METHODDEF \
909
- {"decompressobj", (PyCFunction)(void(*)(void))isal_zlib_decompressobj, METH_FASTCALL |METH_KEYWORDS, isal_zlib_decompressobj__doc__}
909
+ {"decompressobj", (PyCFunction)(void(*)(void))isal_zlib_decompressobj, METH_VARARGS |METH_KEYWORDS, isal_zlib_decompressobj__doc__}
910
910
911
911
static PyObject *
912
- isal_zlib_decompressobj (PyObject * module , PyObject * const * args , Py_ssize_t nargs , PyObject * kwnames )
912
+ isal_zlib_decompressobj (PyObject * module , PyObject * args , PyObject * kwargs )
913
913
{
914
914
PyObject * return_value = NULL ;
915
- static const char * const _keywords [] = {"wbits" , "zdict" , NULL };
916
- static _PyArg_Parser _parser = {NULL , _keywords , "decompressobj" , 0 };
917
- PyObject * argsbuf [2 ];
918
- Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE (kwnames ) : 0 ) - 0 ;
915
+ char * keywords [] = {"wbits" , "zdict" , NULL };
916
+ char * format = "|iO:decompressobj" ;
919
917
int wbits = ISAL_DEF_MAX_HIST_BITS ;
920
918
PyObject * zdict = NULL ;
921
919
922
- args = _PyArg_UnpackKeywords (args , nargs , NULL , kwnames , & _parser , 0 , 2 , 0 , argsbuf );
923
- if (!args ) {
924
- goto exit ;
925
- }
926
- if (!noptargs ) {
927
- goto skip_optional_pos ;
928
- }
929
- if (args [0 ]) {
930
- wbits = _PyLong_AsInt (args [0 ]);
931
- if (wbits == -1 && PyErr_Occurred ()) {
932
- goto exit ;
933
- }
934
- if (!-- noptargs ) {
935
- goto skip_optional_pos ;
936
- }
920
+ if (!PyArg_ParseTupleAndKeywords (
921
+ args , kwargs , format , keywords ,
922
+ & wbits , & zdict )) {
923
+ return NULL ;
937
924
}
938
- zdict = args [1 ];
939
- skip_optional_pos :
940
- return_value = isal_zlib_decompressobj_impl (module , wbits , zdict );
941
-
942
- exit :
943
- return return_value ;
925
+ return isal_zlib_decompressobj_impl (module , wbits , zdict );
944
926
}
945
927
946
928
PyDoc_STRVAR (isal_zlib_Compress_compress__doc__ ,
0 commit comments