We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 393368f commit 4a7d9a1Copy full SHA for 4a7d9a1
Modules/_sqlite/cursor.c
@@ -407,6 +407,7 @@ begin_transaction(pysqlite_Connection *self)
407
Py_END_ALLOW_THREADS
408
409
if (rc != SQLITE_OK) {
410
+ _pysqlite_seterror(self->db);
411
goto error;
412
}
413
@@ -415,15 +416,15 @@ begin_transaction(pysqlite_Connection *self)
415
416
rc = sqlite3_finalize(statement);
417
418
- if (rc != SQLITE_OK) {
419
- goto error;
+ if (rc != SQLITE_OK && !PyErr_Occurred()) {
420
421
422
- return 0;
423
-
424
error:
425
- _pysqlite_seterror(self->db);
426
- return -1;
+ if (PyErr_Occurred()) {
+ return -1;
+ }
427
+ return 0;
428
429
430
static PyObject *
0 commit comments