@@ -1614,12 +1614,15 @@ test_Py_ssize_t_converter
16141614 c: Py_ssize_t(accept={int, NoneType}) = 56
16151615 d: Py_ssize_t(accept={int}, allow_negative=False) = 78
16161616 e: Py_ssize_t(accept={int, NoneType}, allow_negative=False) = 90
1617+ f: Py_ssize_t(accept={int}, allow_negative=True) = 12
1618+ g: Py_ssize_t(accept={int, NoneType}, allow_negative=True) = 34
16171619 /
16181620
16191621[clinic start generated code]*/
16201622
16211623PyDoc_STRVAR (test_Py_ssize_t_converter__doc__ ,
1622- "test_Py_ssize_t_converter($module, a=12, b=34, c=56, d=78, e=90, /)\n"
1624+ "test_Py_ssize_t_converter($module, a=12, b=34, c=56, d=78, e=90, f=12,\n"
1625+ " g=34, /)\n"
16231626"--\n"
16241627"\n" );
16251628
@@ -1628,7 +1631,8 @@ PyDoc_STRVAR(test_Py_ssize_t_converter__doc__,
16281631
16291632static PyObject *
16301633test_Py_ssize_t_converter_impl (PyObject * module , Py_ssize_t a , Py_ssize_t b ,
1631- Py_ssize_t c , Py_ssize_t d , Py_ssize_t e );
1634+ Py_ssize_t c , Py_ssize_t d , Py_ssize_t e ,
1635+ Py_ssize_t f , Py_ssize_t g );
16321636
16331637static PyObject *
16341638test_Py_ssize_t_converter (PyObject * module , PyObject * const * args , Py_ssize_t nargs )
@@ -1639,8 +1643,10 @@ test_Py_ssize_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t na
16391643 Py_ssize_t c = 56 ;
16401644 Py_ssize_t d = 78 ;
16411645 Py_ssize_t e = 90 ;
1646+ Py_ssize_t f = 12 ;
1647+ Py_ssize_t g = 34 ;
16421648
1643- if (!_PyArg_CheckPositional ("test_Py_ssize_t_converter" , nargs , 0 , 5 )) {
1649+ if (!_PyArg_CheckPositional ("test_Py_ssize_t_converter" , nargs , 0 , 7 )) {
16441650 goto exit ;
16451651 }
16461652 if (nargs < 1 ) {
@@ -1695,7 +1701,7 @@ test_Py_ssize_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t na
16951701 d = ival ;
16961702 if (d < 0 ) {
16971703 PyErr_SetString (PyExc_ValueError ,
1698- "d must not be negative " );
1704+ "d must be >=0 " );
16991705 goto exit ;
17001706 }
17011707 }
@@ -1705,17 +1711,39 @@ test_Py_ssize_t_converter(PyObject *module, PyObject *const *args, Py_ssize_t na
17051711 if (!_Py_convert_optional_to_non_negative_ssize_t (args [4 ], & e )) {
17061712 goto exit ;
17071713 }
1714+ if (nargs < 6 ) {
1715+ goto skip_optional ;
1716+ }
1717+ {
1718+ Py_ssize_t ival = -1 ;
1719+ PyObject * iobj = _PyNumber_Index (args [5 ]);
1720+ if (iobj != NULL ) {
1721+ ival = PyLong_AsSsize_t (iobj );
1722+ Py_DECREF (iobj );
1723+ }
1724+ if (ival == -1 && PyErr_Occurred ()) {
1725+ goto exit ;
1726+ }
1727+ f = ival ;
1728+ }
1729+ if (nargs < 7 ) {
1730+ goto skip_optional ;
1731+ }
1732+ if (!_Py_convert_optional_to_ssize_t (args [6 ], & g )) {
1733+ goto exit ;
1734+ }
17081735skip_optional :
1709- return_value = test_Py_ssize_t_converter_impl (module , a , b , c , d , e );
1736+ return_value = test_Py_ssize_t_converter_impl (module , a , b , c , d , e , f , g );
17101737
17111738exit :
17121739 return return_value ;
17131740}
17141741
17151742static PyObject *
17161743test_Py_ssize_t_converter_impl (PyObject * module , Py_ssize_t a , Py_ssize_t b ,
1717- Py_ssize_t c , Py_ssize_t d , Py_ssize_t e )
1718- /*[clinic end generated code: output=df3873c05e53e497 input=5c693ea198fa3dd5]*/
1744+ Py_ssize_t c , Py_ssize_t d , Py_ssize_t e ,
1745+ Py_ssize_t f , Py_ssize_t g )
1746+ /*[clinic end generated code: output=8721e4925ea46578 input=0d80cb5c942b6e0f]*/
17191747
17201748
17211749/*[clinic input]
0 commit comments