File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 * standard Python regression test, via Lib/test/test_capi.py.
66 */
77
8+ #define PY_SSIZE_T_CLEAN
9+
810#include "Python.h"
911#include <float.h>
1012#include "structmember.h"
@@ -377,8 +379,8 @@ getargs_n(PyObject *self, PyObject *args)
377379{
378380 Py_ssize_t value ;
379381 if (!PyArg_ParseTuple (args , "n" , & value ))
380- return NULL ;
381- return PyInt_FromSsize_t (value );
382+ return NULL ;
383+ return PyLong_FromSsize_t (value );
382384}
383385
384386#ifdef HAVE_LONG_LONG
@@ -465,7 +467,7 @@ test_u_code(PyObject *self)
465467{
466468 PyObject * tuple , * obj ;
467469 Py_UNICODE * value ;
468- int len ;
470+ Py_ssize_t len ;
469471
470472 tuple = PyTuple_New (1 );
471473 if (tuple == NULL )
@@ -503,7 +505,7 @@ test_Z_code(PyObject *self)
503505{
504506 PyObject * tuple , * obj ;
505507 Py_UNICODE * value1 , * value2 ;
506- int len1 , len2 ;
508+ Py_ssize_t len1 , len2 ;
507509
508510 tuple = PyTuple_New (2 );
509511 if (tuple == NULL )
You can’t perform that action at this time.
0 commit comments