Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8866e0a

Browse files
committed
Try to get this test to pass on Win64 by making clean for ssize_t
1 parent bed6784 commit 8866e0a

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Modules/_testcapimodule.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
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)

0 commit comments

Comments
 (0)