@@ -437,57 +437,17 @@ static int
437
437
igzip_lib_IgzipDecompressor___init__ (PyObject * self , PyObject * args , PyObject * kwargs )
438
438
{
439
439
int return_value = -1 ;
440
- static const char * const _keywords [] = {"flag" , "hist_bits" , "zdict" , NULL };
441
- static _PyArg_Parser _parser = {NULL , _keywords , "IgzipDecompressor" , 0 };
442
- PyObject * argsbuf [3 ];
443
- PyObject * const * fastargs ;
444
- Py_ssize_t nargs = PyTuple_GET_SIZE (args );
445
- Py_ssize_t noptargs = nargs + (kwargs ? PyDict_GET_SIZE (kwargs ) : 0 ) - 0 ;
440
+ char * keywords [] = {"flag" , "hist_bits" , "zdict" , NULL };
441
+ char * format = "|iiO:IgzipDecompressor" ;
446
442
int flag = ISAL_DEFLATE ;
447
443
int hist_bits = ISAL_DEF_MAX_HIST_BITS ;
448
444
PyObject * zdict = NULL ;
449
445
450
- fastargs = _PyArg_UnpackKeywords (_PyTuple_CAST (args )-> ob_item , nargs , kwargs , NULL , & _parser , 0 , 3 , 0 , argsbuf );
451
- if (!fastargs ) {
452
- goto exit ;
453
- }
454
- if (!noptargs ) {
455
- goto skip_optional_pos ;
456
- }
457
- if (fastargs [0 ]) {
458
- if (PyFloat_Check (fastargs [0 ])) {
459
- PyErr_SetString (PyExc_TypeError ,
460
- "integer argument expected, got float" );
461
- goto exit ;
462
- }
463
- flag = _PyLong_AsInt (fastargs [0 ]);
464
- if (flag == -1 && PyErr_Occurred ()) {
465
- goto exit ;
466
- }
467
- if (!-- noptargs ) {
468
- goto skip_optional_pos ;
469
- }
470
- }
471
- if (fastargs [1 ]) {
472
- if (PyFloat_Check (fastargs [1 ])) {
473
- PyErr_SetString (PyExc_TypeError ,
474
- "integer argument expected, got float" );
475
- goto exit ;
476
- }
477
- hist_bits = _PyLong_AsInt (fastargs [1 ]);
478
- if (hist_bits == -1 && PyErr_Occurred ()) {
479
- goto exit ;
480
- }
481
- if (!-- noptargs ) {
482
- goto skip_optional_pos ;
483
- }
446
+ if (!PyArg_ParseTupleAndKeywords (
447
+ args , kwargs , format , keywords , & flag , & hist_bits , & zdict )) {
448
+ return NULL ;
484
449
}
485
- zdict = fastargs [2 ];
486
- skip_optional_pos :
487
- return_value = igzip_lib_IgzipDecompressor___init___impl ((IgzipDecompressor * )self , flag , hist_bits , zdict );
488
-
489
- exit :
490
- return return_value ;
450
+ return igzip_lib_IgzipDecompressor___init___impl ((IgzipDecompressor * )self , flag , hist_bits , zdict );
491
451
}
492
452
493
453
static PyMethodDef IgzipDecompressor_methods [] = {
0 commit comments