[Python-checkins] r80695 - python/trunk/Objects/intobject.c

mark.dickinson python-checkins at python.org
Sun May 2 11:38:43 CEST 2010


Author: mark.dickinson
Date: Sun May  2 11:38:43 2010
New Revision: 80695

Log:
Improve error message from nb_int returning a non-integer, in various PyInt_As* functions:


Modified:
   python/trunk/Objects/intobject.c

Modified: python/trunk/Objects/intobject.c
==============================================================================
--- python/trunk/Objects/intobject.c	(original)
+++ python/trunk/Objects/intobject.c	Sun May  2 11:38:43 2010
@@ -178,7 +178,7 @@
 		{
 			Py_DECREF(io);
 			PyErr_SetString(PyExc_TypeError,
-					"nb_int should return int object");
+				    "__int__ method should return an integer");
 			return -1;
 		}
 	}
@@ -236,7 +236,7 @@
 		{
 			Py_DECREF(io);
 			PyErr_SetString(PyExc_TypeError,
-					"nb_int should return int object");
+				    "__int__ method should return an integer");
 			return -1;
 		}
 	}
@@ -281,7 +281,7 @@
 		{
 			Py_DECREF(io);
 			PyErr_SetString(PyExc_TypeError,
-					"nb_int should return int object");
+				    "__int__ method should return an integer");
 			return (unsigned long)-1;
 		}
 	}
@@ -326,7 +326,7 @@
 		{
 			Py_DECREF(io);
 			PyErr_SetString(PyExc_TypeError,
-					"nb_int should return int object");
+				    "__int__ method should return an integer");
 			return (unsigned PY_LONG_LONG)-1;
 		}
 	}


More information about the Python-checkins mailing list