@@ -360,6 +360,15 @@ getargs_l(PyObject *self, PyObject *args)
360360 return PyLong_FromLong (value );
361361}
362362
363+ static PyObject *
364+ getargs_n (PyObject * self , PyObject * args )
365+ {
366+ Py_ssize_t value ;
367+ if (!PyArg_ParseTuple (args , "n" , & value ))
368+ return NULL ;
369+ return PyInt_FromSsize_t (value );
370+ }
371+
363372#ifdef HAVE_LONG_LONG
364373static PyObject *
365374getargs_L (PyObject * self , PyObject * args )
@@ -661,17 +670,18 @@ static PyMethodDef TestMethods[] = {
661670 {"test_k_code" , (PyCFunction )test_k_code , METH_NOARGS },
662671 {"test_null_strings" , (PyCFunction )test_null_strings , METH_NOARGS },
663672
664- {"getargs_b" , (PyCFunction )getargs_b , METH_VARARGS },
665- {"getargs_B" , (PyCFunction )getargs_B , METH_VARARGS },
666- {"getargs_H" , (PyCFunction )getargs_H , METH_VARARGS },
667- {"getargs_I" , (PyCFunction )getargs_I , METH_VARARGS },
668- {"getargs_k" , (PyCFunction )getargs_k , METH_VARARGS },
669- {"getargs_i" , (PyCFunction )getargs_i , METH_VARARGS },
670- {"getargs_l" , (PyCFunction )getargs_l , METH_VARARGS },
673+ {"getargs_b" , getargs_b , METH_VARARGS },
674+ {"getargs_B" , getargs_B , METH_VARARGS },
675+ {"getargs_H" , getargs_H , METH_VARARGS },
676+ {"getargs_I" , getargs_I , METH_VARARGS },
677+ {"getargs_k" , getargs_k , METH_VARARGS },
678+ {"getargs_i" , getargs_i , METH_VARARGS },
679+ {"getargs_l" , getargs_l , METH_VARARGS },
680+ {"getargs_n" , getargs_n , METH_VARARGS },
671681#ifdef HAVE_LONG_LONG
672- {"getargs_L" , ( PyCFunction ) getargs_L , METH_VARARGS },
673- {"getargs_K" , ( PyCFunction ) getargs_K , METH_VARARGS },
674- {"test_longlong_api" , ( PyCFunction ) test_longlong_api , METH_NOARGS },
682+ {"getargs_L" , getargs_L , METH_VARARGS },
683+ {"getargs_K" , getargs_K , METH_VARARGS },
684+ {"test_longlong_api" , test_longlong_api , METH_NOARGS },
675685 {"test_L_code" , (PyCFunction )test_L_code , METH_NOARGS },
676686 {"codec_incrementalencoder" ,
677687 (PyCFunction )codec_incrementalencoder , METH_VARARGS },
@@ -682,7 +692,7 @@ static PyMethodDef TestMethods[] = {
682692 {"test_u_code" , (PyCFunction )test_u_code , METH_NOARGS },
683693#endif
684694#ifdef WITH_THREAD
685- {"_test_thread_state" , ( PyCFunction ) test_thread_state , METH_VARARGS },
695+ {"_test_thread_state" , test_thread_state , METH_VARARGS },
686696#endif
687697 {NULL , NULL } /* sentinel */
688698};
0 commit comments