Skip to content

Commit

Permalink
bpo-43290: Remove workaround from pysqlite_step() (GH-24638)
Browse files Browse the repository at this point in the history
From the SQLite 3.5.3 changelog:

sqlite3_step() returns SQLITE_MISUSE instead of crashing when called
with a NULL parameter.

The workaround no longer needed because we no longer support
SQLite releases older than 3.7.15.
  • Loading branch information
Erlend Egeberg Aasland authored Feb 25, 2021
1 parent cc3df63 commit 91ea37c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Modules/_sqlite/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,9 @@ int pysqlite_step(sqlite3_stmt* statement, pysqlite_Connection* connection)
{
int rc;

if (statement == NULL) {
/* this is a workaround for SQLite 3.5 and later. it now apparently
* returns NULL for "no-operation" statements */
rc = SQLITE_OK;
} else {
Py_BEGIN_ALLOW_THREADS
rc = sqlite3_step(statement);
Py_END_ALLOW_THREADS
}
Py_BEGIN_ALLOW_THREADS
rc = sqlite3_step(statement);
Py_END_ALLOW_THREADS

return rc;
}
Expand Down

0 comments on commit 91ea37c

Please sign in to comment.