[Python-3000-checkins] r58685 - python/branches/py3k/Modules/_testcapimodule.c

neal.norwitz python-3000-checkins at python.org
Sat Oct 27 06:01:17 CEST 2007


Author: neal.norwitz
Date: Sat Oct 27 06:01:17 2007
New Revision: 58685

Modified:
   python/branches/py3k/Modules/_testcapimodule.c
Log:
Try to get this test to pass on Win64 by making clean for ssize_t

Modified: python/branches/py3k/Modules/_testcapimodule.c
==============================================================================
--- python/branches/py3k/Modules/_testcapimodule.c	(original)
+++ python/branches/py3k/Modules/_testcapimodule.c	Sat Oct 27 06:01:17 2007
@@ -5,6 +5,8 @@
  * standard Python regression test, via Lib/test/test_capi.py.
  */
 
+#define PY_SSIZE_T_CLEAN
+
 #include "Python.h"
 #include <float.h>
 #include "structmember.h"
@@ -377,8 +379,8 @@
 {
 	Py_ssize_t value;
 	if (!PyArg_ParseTuple(args, "n", &value))
-	return NULL;
-	return PyInt_FromSsize_t(value);
+		return NULL;
+	return PyLong_FromSsize_t(value);
 }
 
 #ifdef HAVE_LONG_LONG
@@ -465,7 +467,7 @@
 {
 	PyObject *tuple, *obj;
 	Py_UNICODE *value;
-	int len;
+	Py_ssize_t len;
 
         tuple = PyTuple_New(1);
         if (tuple == NULL)
@@ -503,7 +505,7 @@
 {
 	PyObject *tuple, *obj;
 	Py_UNICODE *value1, *value2;
-	int len1, len2;
+	Py_ssize_t len1, len2;
 
         tuple = PyTuple_New(2);
         if (tuple == NULL)


More information about the Python-3000-checkins mailing list