Skip to content

Commit 25e244c

Browse files
authored
bpo-39523: Use do-while loop pysqlite_cursor_executescript() (GH-18305)
1 parent 5bfa945 commit 25e244c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Modules/_sqlite/cursor.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -715,14 +715,13 @@ pysqlite_cursor_executescript(pysqlite_Cursor *self, PyObject *script_obj)
715715
}
716716

717717
/* execute statement, and ignore results of SELECT statements */
718-
rc = SQLITE_ROW;
719-
while (rc == SQLITE_ROW) {
718+
do {
720719
rc = pysqlite_step(statement, self->connection);
721720
if (PyErr_Occurred()) {
722721
(void)sqlite3_finalize(statement);
723722
goto error;
724723
}
725-
}
724+
} while (rc == SQLITE_ROW);
726725

727726
if (rc != SQLITE_DONE) {
728727
(void)sqlite3_finalize(statement);

0 commit comments

Comments
 (0)