File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -372,16 +372,27 @@ PyDoc_STRVAR(ParallelCompress_compress_and_crc__doc__,
372
372
#define PARALLELCOMPRESS_COMPRESS_AND_CRC_METHODDEF \
373
373
{ \
374
374
"compress_and_crc", (PyCFunction)ParallelCompress_compress_and_crc, \
375
- METH_VARARGS , ParallelCompress_compress_and_crc__doc__}
375
+ METH_FASTCALL , ParallelCompress_compress_and_crc__doc__}
376
376
377
377
static PyObject *
378
- ParallelCompress_compress_and_crc (ParallelCompress * self , PyObject * args )
378
+ ParallelCompress_compress_and_crc (ParallelCompress * self ,
379
+ PyObject * const * args ,
380
+ Py_ssize_t nargs )
379
381
{
382
+ if (nargs != 2 ) {
383
+ PyErr_Format (
384
+ PyExc_TypeError ,
385
+ "compress_and_crc takes exactly 2 arguments, got %zd" ,
386
+ nargs );
387
+ return NULL ;
388
+ }
380
389
Py_buffer data ;
381
390
Py_buffer zdict ;
382
- static char * format = "y*y*:compress_and_crc" ;
383
-
384
- if (PyArg_ParseTuple (args , format , & data , & zdict ) < 0 ) {
391
+ if (PyObject_GetBuffer (args [0 ], & data , PyBUF_SIMPLE ) == -1 ) {
392
+ return NULL ;
393
+ }
394
+ if (PyObject_GetBuffer (args [1 ], & zdict , PyBUF_SIMPLE ) == -1 ) {
395
+ PyBuffer_Release (& data );
385
396
return NULL ;
386
397
}
387
398
You can’t perform that action at this time.
0 commit comments