]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43290: Remove workaround from pysqlite_step() (GH-24638)
authorErlend Egeberg Aasland <erlend.aasland@innova.no>
Thu, 25 Feb 2021 23:39:34 +0000 (00:39 +0100)
committerGitHub <noreply@github.com>
Thu, 25 Feb 2021 23:39:34 +0000 (01:39 +0200)
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.

Modules/_sqlite/util.c

index 1dbabcdd94a811fe6beef0653a146009dff4a518..0f4eba0ab31b60f4ce7034eb251109804662b64c 100644 (file)
@@ -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;
 }