mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
[3.12] gh-117995: Don't raise DeprecationWarnings for indexed nameless params (GH-118001) (#118142)
Filter out '?NNN' placeholders when looking for named params.
(cherry picked from commit 550483b7e6
)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
This commit is contained in:
parent
6d87cb494b
commit
9ddaf75a4c
3 changed files with 17 additions and 1 deletions
|
@ -663,7 +663,7 @@ bind_parameters(pysqlite_state *state, pysqlite_Statement *self,
|
|||
}
|
||||
for (i = 0; i < num_params; i++) {
|
||||
const char *name = sqlite3_bind_parameter_name(self->st, i+1);
|
||||
if (name != NULL) {
|
||||
if (name != NULL && name[0] != '?') {
|
||||
int ret = PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
|
||||
"Binding %d ('%s') is a named parameter, but you "
|
||||
"supplied a sequence which requires nameless (qmark) "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue