Skip to content

Commit

Permalink
Remove unused variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaering committed Aug 20, 2015
1 parent 56eb337 commit a74cecb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 21 deletions.
4 changes: 0 additions & 4 deletions src/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject
int cached_statements = 100;
double timeout = 5.0;
int rc;
PyObject* class_attr = NULL;
PyObject* class_attr_str = NULL;
PyObject* database_utf8;

if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|diOiOi", kwlist,
Expand Down Expand Up @@ -211,8 +209,6 @@ void pysqlite_do_all_statements(pysqlite_Connection* self, int action)

void pysqlite_connection_dealloc(pysqlite_Connection* self)
{
PyObject* ret = NULL;

Py_XDECREF(self->statement_cache);

/* Clean up if user has not called .close() explicitly. */
Expand Down
14 changes: 0 additions & 14 deletions src/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,6 @@ static int check_cursor(pysqlite_Cursor* cur)
PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* args)
{
PyObject* operation;
PyObject* operation_bytestr = NULL;
char* operation_cstr;
PyObject* parameters_list = NULL;
PyObject* parameters_iter = NULL;
PyObject* parameters = NULL;
Expand Down Expand Up @@ -494,17 +492,6 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
rc = pysqlite_statement_reset(self->statement);
}

if (PyString_Check(operation)) {
operation_cstr = PyString_AsString(operation);
} else {
operation_bytestr = PyUnicode_AsUTF8String(operation);
if (!operation_bytestr) {
goto error;
}

operation_cstr = PyString_AsString(operation_bytestr);
}

/* reset description and rowcount */
Py_DECREF(self->description);
Py_INCREF(Py_None);
Expand Down Expand Up @@ -655,7 +642,6 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
}

error:
Py_XDECREF(operation_bytestr);
Py_XDECREF(parameters);
Py_XDECREF(parameters_iter);
Py_XDECREF(parameters_list);
Expand Down
4 changes: 1 addition & 3 deletions src/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,9 @@ void pysqlite_statement_mark_dirty(pysqlite_Statement* self)

void pysqlite_statement_dealloc(pysqlite_Statement* self)
{
int rc;

if (self->st) {
Py_BEGIN_ALLOW_THREADS
rc = sqlite3_finalize(self->st);
(void)sqlite3_finalize(self->st);
Py_END_ALLOW_THREADS
}

Expand Down

0 comments on commit a74cecb

Please sign in to comment.