diff Objects/methodobject.c @ 36519:d6d415df0df0 legacy-trunk

Use Py_ssize_t for counts and sizes. Convert Py_ssize_t using PyInt_FromSsize_t
author Martin v. Löwis <martin@v.loewis.de>
date Thu, 16 Feb 2006 14:32:27 +0000
parents 7fdc639bc5b4
children 7b2e436a4a21
line wrap: on
line diff
--- a/Objects/methodobject.c	Thu Feb 16 14:30:23 2006 +0000
+++ b/Objects/methodobject.c	Thu Feb 16 14:32:27 2006 +0000
@@ -65,7 +65,7 @@
 	PyCFunctionObject* f = (PyCFunctionObject*)func;
 	PyCFunction meth = PyCFunction_GET_FUNCTION(func);
 	PyObject *self = PyCFunction_GET_SELF(func);
-	long size;
+	Py_ssize_t size;
 
 	switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
 	case METH_VARARGS:
@@ -81,7 +81,7 @@
 			if (size == 0)
 				return (*meth)(self, NULL);
 			PyErr_Format(PyExc_TypeError,
-			    "%.200s() takes no arguments (%ld given)",
+			    "%.200s() takes no arguments (%zd given)",
 			    f->m_ml->ml_name, size);
 			return NULL;
 		}
@@ -92,7 +92,7 @@
 			if (size == 1)
 				return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
 			PyErr_Format(PyExc_TypeError,
-			    "%.200s() takes exactly one argument (%ld given)",
+			    "%.200s() takes exactly one argument (%zd given)",
 			    f->m_ml->ml_name, size);
 			return NULL;
 		}