@@ -939,29 +939,18 @@ PyDoc_STRVAR(isal_zlib_Compress_compress__doc__,
939
939
"Call the flush() method to clear these buffers." );
940
940
941
941
#define ISAL_ZLIB_COMPRESS_COMPRESS_METHODDEF \
942
- {"compress", (PyCFunction)(void(*)(void))isal_zlib_Compress_compress, METH_FASTCALL|METH_KEYWORDS , isal_zlib_Compress_compress__doc__}
942
+ {"compress", (PyCFunction)(void(*)(void))isal_zlib_Compress_compress, METH_O , isal_zlib_Compress_compress__doc__}
943
943
944
944
945
945
static PyObject *
946
- isal_zlib_Compress_compress (compobject * self , PyObject * const * args , Py_ssize_t nargs , PyObject * kwnames )
946
+ isal_zlib_Compress_compress (compobject * self , PyObject * data )
947
947
{
948
- PyObject * return_value = NULL ;
949
- static const char * const _keywords [] = {"" , NULL };
950
- static _PyArg_Parser _parser = {"y*:compress" , _keywords , 0 };
951
- Py_buffer data = {NULL , NULL };
952
-
953
- if (!_PyArg_ParseStackAndKeywords (args , nargs , kwnames , & _parser ,
954
- & data )) {
955
- goto exit ;
956
- }
957
- return_value = isal_zlib_Compress_compress_impl (self , & data );
958
-
959
- exit :
960
- /* Cleanup for data */
961
- if (data .obj ) {
962
- PyBuffer_Release (& data );
948
+ Py_buffer data_buf ;
949
+ if (PyObject_GetBuffer (data , & data_buf , PyBUF_SIMPLE ) < 0 ) {
950
+ return NULL ;
963
951
}
964
-
952
+ PyObject * return_value = isal_zlib_Compress_compress_impl (self , & data_buf );
953
+ PyBuffer_Release (& data_buf );
965
954
return return_value ;
966
955
}
967
956
0 commit comments