Skip to content

Commit 7459208

Browse files
author
Erlend Egeberg Aasland
authored
bpo-44315: Remove unused connection argument from pysqlite_step() (GH-26535)
1 parent 006fd86 commit 7459208

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

Modules/_sqlite/connection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ pysqlite_connection_commit_impl(pysqlite_Connection *self)
432432
goto error;
433433
}
434434

435-
rc = pysqlite_step(statement, self);
435+
rc = pysqlite_step(statement);
436436
if (rc != SQLITE_DONE) {
437437
_pysqlite_seterror(self->db);
438438
}
@@ -482,7 +482,7 @@ pysqlite_connection_rollback_impl(pysqlite_Connection *self)
482482
goto error;
483483
}
484484

485-
rc = pysqlite_step(statement, self);
485+
rc = pysqlite_step(statement);
486486
if (rc != SQLITE_DONE) {
487487
_pysqlite_seterror(self->db);
488488
}

Modules/_sqlite/cursor.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* operation
568568
goto error;
569569
}
570570

571-
rc = pysqlite_step(self->statement->st, self->connection);
571+
rc = pysqlite_step(self->statement->st);
572572
if (rc != SQLITE_DONE && rc != SQLITE_ROW) {
573573
if (PyErr_Occurred()) {
574574
/* there was an error that occurred in a user-defined callback */
@@ -773,7 +773,7 @@ pysqlite_cursor_executescript(pysqlite_Cursor *self, PyObject *script_obj)
773773

774774
/* execute statement, and ignore results of SELECT statements */
775775
do {
776-
rc = pysqlite_step(statement, self->connection);
776+
rc = pysqlite_step(statement);
777777
if (PyErr_Occurred()) {
778778
(void)sqlite3_finalize(statement);
779779
goto error;
@@ -847,7 +847,7 @@ pysqlite_cursor_iternext(pysqlite_Cursor *self)
847847
}
848848

849849
if (self->statement) {
850-
rc = pysqlite_step(self->statement->st, self->connection);
850+
rc = pysqlite_step(self->statement->st);
851851
if (PyErr_Occurred()) {
852852
(void)pysqlite_statement_reset(self->statement);
853853
Py_DECREF(next_row);

Modules/_sqlite/util.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
#include "module.h"
2525
#include "connection.h"
2626

27-
int pysqlite_step(sqlite3_stmt* statement, pysqlite_Connection* connection)
27+
int
28+
pysqlite_step(sqlite3_stmt *statement)
2829
{
2930
int rc;
3031

Modules/_sqlite/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "sqlite3.h"
3030
#include "connection.h"
3131

32-
int pysqlite_step(sqlite3_stmt* statement, pysqlite_Connection* connection);
32+
int pysqlite_step(sqlite3_stmt *statement);
3333

3434
/**
3535
* Checks the SQLite error code and sets the appropriate DB-API exception.

0 commit comments

Comments
 (0)