Index: Modules/_sqlite/statement.c =================================================================== --- Modules/_sqlite/statement.c (revision 62122) +++ Modules/_sqlite/statement.c (working copy) @@ -89,10 +89,6 @@ int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObject* parameter, int allow_8bit_chars) { int rc = SQLITE_OK; - long longval; -#ifdef HAVE_LONG_LONG - PY_LONG_LONG longlongval; -#endif const char* buffer; char* string; Py_ssize_t buflen; @@ -135,12 +131,11 @@ switch (paramtype) { case TYPE_LONG: - /* in the overflow error case, longval/longlongval is -1, and an exception is set */ -#ifdef HAVE_LONG_LONG - longlongval = PyLong_AsLongLong(parameter); - rc = sqlite3_bind_int64(self->st, pos, (sqlite_int64)longlongval); + /* in the overflow error case, 3rd paramter is -1, and an exception is set */ +#ifdef HAVE_LONG_LONG + rc = sqlite3_bind_int64(self->st, pos, (sqlite_int64)PyLong_AsLongLong(parameter)); #else - rc = sqlite3_bind_int64(self->st, pos, (sqlite_int64)longval); + rc = sqlite3_bind_int64(self->st, pos, (sqlite_int64)PyLong_AsLong(parameter)); #endif break; case TYPE_FLOAT: