summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2012-02-21 11:59:34 (GMT)
committerPetri Lehtinen <petri@digip.org>2012-02-21 11:59:40 (GMT)
commit8b24506534860b6c1cfa7f53c40113d502f4c78f (patch)
tree6ee951cd4c9865f21a3323be82ff94bb18a8b727 /Modules/_sqlite
parent307da2b07040d0eea179cf989e3de8d9e75a9b2f (diff)
parent4fe85abab9f0188733e654a72353217b43f95920 (diff)
downloadcpython-8b24506534860b6c1cfa7f53c40113d502f4c78f.zip
cpython-8b24506534860b6c1cfa7f53c40113d502f4c78f.tar.gz
cpython-8b24506534860b6c1cfa7f53c40113d502f4c78f.tar.bz2
Merge branch '3.2'
Closes #8033.
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r--Modules/_sqlite/connection.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 5cbf418..bc4ce50 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -484,7 +484,6 @@ error:
void _pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
{
- long longval;
const char* buffer;
Py_ssize_t buflen;
@@ -493,8 +492,7 @@ void _pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
} else if (py_val == Py_None) {
sqlite3_result_null(context);
} else if (PyLong_Check(py_val)) {
- longval = PyLong_AsLong(py_val);
- sqlite3_result_int64(context, (PY_LONG_LONG)longval);
+ sqlite3_result_int64(context, PyLong_AsLongLong(py_val));
} else if (PyFloat_Check(py_val)) {
sqlite3_result_double(context, PyFloat_AsDouble(py_val));
} else if (PyUnicode_Check(py_val)) {
@@ -519,7 +517,6 @@ PyObject* _pysqlite_build_py_params(sqlite3_context *context, int argc, sqlite3_
sqlite3_value* cur_value;
PyObject* cur_py_value;
const char* val_str;
- PY_LONG_LONG val_int;
Py_ssize_t buflen;
args = PyTuple_New(argc);
@@ -531,8 +528,7 @@ PyObject* _pysqlite_build_py_params(sqlite3_context *context, int argc, sqlite3_
cur_value = argv[i];
switch (sqlite3_value_type(argv[i])) {
case SQLITE_INTEGER:
- val_int = sqlite3_value_int64(cur_value);
- cur_py_value = PyLong_FromLong((long)val_int);
+ cur_py_value = PyLong_FromLongLong(sqlite3_value_int64(cur_value));
break;
case SQLITE_FLOAT:
cur_py_value = PyFloat_FromDouble(sqlite3_value_double(cur_value));