bpo-43290: Remove workaround from pysqlite_step() (GH-24638)
https://github.com/python/cpython/commit/91ea37c84af2dd5ea92802a4c2adad47861... commit: 91ea37c84af2dd5ea92802a4c2adad47861ac067 branch: master author: Erlend Egeberg Aasland <erlend.aasland@innova.no> committer: berkerpeksag <berker.peksag@gmail.com> date: 2021-02-26T01:39:34+02:00 summary: bpo-43290: Remove workaround from pysqlite_step() (GH-24638)
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. files: M Modules/_sqlite/util.c diff --git a/Modules/_sqlite/util.c b/Modules/_sqlite/util.c index 1dbabcdd94a81..0f4eba0ab31b6 100644 --- a/Modules/_sqlite/util.c +++ b/Modules/_sqlite/util.c @@ -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; }
participants (1)
-
berkerpeksag