@@ -1618,7 +1618,7 @@ sre_literal_template(int charsize, char* ptr, Py_ssize_t len)
16181618static PyObject *
16191619sre_codesize (PyObject * self , PyObject * unused )
16201620{
1621- return Py_BuildValue ( "l" , sizeof (SRE_CODE ));
1621+ return PyLong_FromSize_t ( sizeof (SRE_CODE ));
16221622}
16231623
16241624static PyObject *
@@ -2435,7 +2435,7 @@ pattern_subx(PatternObject* self, PyObject* ptemplate, PyObject* string,
24352435 return NULL ;
24362436
24372437 if (subn )
2438- return Py_BuildValue ("Ni " , item , n );
2438+ return Py_BuildValue ("Nn " , item , n );
24392439
24402440 return item ;
24412441
@@ -3387,7 +3387,7 @@ match_start(MatchObject* self, PyObject* args)
33873387 }
33883388
33893389 /* mark is -1 if group is undefined */
3390- return Py_BuildValue ( "i" , self -> mark [index * 2 ]);
3390+ return PyLong_FromSsize_t ( self -> mark [index * 2 ]);
33913391}
33923392
33933393static PyObject *
@@ -3410,7 +3410,7 @@ match_end(MatchObject* self, PyObject* args)
34103410 }
34113411
34123412 /* mark is -1 if group is undefined */
3413- return Py_BuildValue ( "i" , self -> mark [index * 2 + 1 ]);
3413+ return PyLong_FromSsize_t ( self -> mark [index * 2 + 1 ]);
34143414}
34153415
34163416LOCAL (PyObject * )
@@ -3560,7 +3560,7 @@ static PyObject *
35603560match_lastindex_get (MatchObject * self )
35613561{
35623562 if (self -> lastindex >= 0 )
3563- return Py_BuildValue ( "i" , self -> lastindex );
3563+ return PyLong_FromSsize_t ( self -> lastindex );
35643564 Py_INCREF (Py_None );
35653565 return Py_None ;
35663566}
0 commit comments