Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6902738

Browse files
Explicit logic in set_autocommit
1 parent 76122be commit 6902738

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Modules/_sqlite/connection.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,11 +2350,11 @@ set_autocommit(pysqlite_Connection *self, PyObject *val, void *Py_UNUSED(ctx))
23502350
if (!autocommit_converter(val, &self->autocommit)) {
23512351
return -1;
23522352
}
2353-
if (self->autocommit == AUTOCOMMIT_ENABLED &&
2354-
!sqlite3_get_autocommit(self->db))
2355-
{
2356-
if (connection_txn_stmt(self, "COMMIT") < 0) {
2357-
return -1;
2353+
if (self->autocommit == AUTOCOMMIT_ENABLED) {
2354+
if (!sqlite3_get_autocommit(self->db)) {
2355+
if (connection_txn_stmt(self, "COMMIT") < 0) {
2356+
return -1;
2357+
}
23582358
}
23592359
}
23602360
else if (self->autocommit == AUTOCOMMIT_DISABLED) {

0 commit comments

Comments
 (0)