bpo-39523: Replace while loop in pysqlite_cursor_executescript with do-while loop

This commit is contained in:
Alex Henrie 2020-02-01 19:05:24 -07:00
parent 78c7183f47
commit 33cf8f911b
1 changed files with 2 additions and 3 deletions

View File

@ -657,14 +657,13 @@ pysqlite_cursor_executescript(pysqlite_Cursor* self, PyObject* args)
}
/* execute statement, and ignore results of SELECT statements */
rc = SQLITE_ROW;
while (rc == SQLITE_ROW) {
do {
rc = pysqlite_step(statement, self->connection);
if (PyErr_Occurred()) {
(void)sqlite3_finalize(statement);
goto error;
}
}
} while (rc == SQLITE_ROW);
if (rc != SQLITE_DONE) {
(void)sqlite3_finalize(statement);