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

Skip to content

Commit 3f94201

Browse files
Address review: add PyErr_WarnFormat error handling
1 parent a18d0bb commit 3f94201

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

Modules/_sqlite/cursor.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -664,13 +664,15 @@ bind_parameters(pysqlite_state *state, pysqlite_Statement *self,
664664
for (i = 0; i < num_params; i++) {
665665
const char *name = sqlite3_bind_parameter_name(self->st, i+1);
666666
if (name != NULL) {
667-
PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
668-
"Binding %d ('%s') is a named parameter, "
669-
"but you supplied a sequence which requires "
670-
"nameless (qmark) placeholders. "
671-
"Starting with Python 3.14 an "
672-
"sqlite3.ProgrammingError will be raised.",
673-
i+1, name);
667+
int ret = PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
668+
"Binding %d ('%s') is a named parameter, but you "
669+
"supplied a sequence which requires nameless (qmark) "
670+
"placeholders. Starting with Python 3.14 an "
671+
"sqlite3.ProgrammingError will be raised.",
672+
i+1, name);
673+
if (ret < 0) {
674+
return;
675+
}
674676
}
675677

676678
if (PyTuple_CheckExact(parameters)) {

0 commit comments

Comments
 (0)