[Python-3000-checkins] r53446 - in python/branches/p3yk: Misc/NEWS Modules/_sqlite/statement.c Objects/longobject.c
guido.van.rossum
python-3000-checkins at python.org
Mon Jan 15 01:31:50 CET 2007
Author: guido.van.rossum
Date: Mon Jan 15 01:31:49 2007
New Revision: 53446
Modified:
python/branches/p3yk/Misc/NEWS
python/branches/p3yk/Modules/_sqlite/statement.c
python/branches/p3yk/Objects/longobject.c
Log:
Fix the sqlite failure -- it was the usual, PyInt_Check -> PyInt_CheckExact.
Clarify some OverflowError messages from the various PyLong_AsXXX methods.
Modified: python/branches/p3yk/Misc/NEWS
==============================================================================
--- python/branches/p3yk/Misc/NEWS (original)
+++ python/branches/p3yk/Misc/NEWS Mon Jan 15 01:31:49 2007
@@ -36,9 +36,9 @@
Core and Builtins
-----------------
-- Int/Long unification is halfway complete. There are a few broken tests,
- the 'long' built-in hasn't been removed yet, and literals with trailing
- 'L' or 'l' are still recognized. Performance may be sub-optimal.
+- Int/Long unification is halfway complete. The 'long' built-in type
+ hasn't been removed yet, and literals with trailing 'L' or 'l' are
+ still recognized. Performance may be sub-optimal.
- 'except E, V' must now be spelled as 'except E as V' and deletes V
at the end of the except clause; V must be a simple name.
Modified: python/branches/p3yk/Modules/_sqlite/statement.c
==============================================================================
--- python/branches/p3yk/Modules/_sqlite/statement.c (original)
+++ python/branches/p3yk/Modules/_sqlite/statement.c Mon Jan 15 01:31:49 2007
@@ -100,7 +100,7 @@
if (parameter == Py_None) {
rc = sqlite3_bind_null(self->st, pos);
- } else if (PyInt_Check(parameter)) {
+ } else if (PyInt_CheckExact(parameter)) {
longval = PyInt_AsLong(parameter);
rc = sqlite3_bind_int64(self->st, pos, (sqlite_int64)longval);
#ifdef HAVE_LONG_LONG
Modified: python/branches/p3yk/Objects/longobject.c
==============================================================================
--- python/branches/p3yk/Objects/longobject.c (original)
+++ python/branches/p3yk/Objects/longobject.c Mon Jan 15 01:31:49 2007
@@ -364,7 +364,7 @@
Py_DECREF(vv);
}
PyErr_SetString(PyExc_OverflowError,
- "int too large to convert to int");
+ "Python int too large to convert to C long");
return -1;
}
@@ -427,7 +427,7 @@
overflow:
PyErr_SetString(PyExc_OverflowError,
- "int too large to convert to ");
+ "Python int too large to convert to C ssize_t");
return -1;
}
@@ -462,7 +462,7 @@
x = (x << SHIFT) + v->ob_digit[i];
if ((x >> SHIFT) != prev) {
PyErr_SetString(PyExc_OverflowError,
- "int too large to convert");
+ "python int too large to convert to C unsigned long");
return (unsigned long) -1;
}
}
@@ -500,7 +500,7 @@
x = (x << SHIFT) + v->ob_digit[i];
if ((x >> SHIFT) != prev) {
PyErr_SetString(PyExc_OverflowError,
- "int too large to convert");
+ "Python int too large to convert to C size_t");
return (unsigned long) -1;
}
}
@@ -943,7 +943,7 @@
overflow:
PyErr_SetString(PyExc_OverflowError,
- "int too large to convert to float");
+ "Python int too large to convert to C double");
return -1.0;
}
More information about the Python-3000-checkins
mailing list