bpo-37406: sqlite3 raises TypeError for wrong operation type (GH-14386)
The sqlite3 module now raises TypeError, rather than ValueError, if
operation argument type is not str: execute(), executemany() and
calling a connection.
diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c
index 491294b..9de8f9b 100644
--- a/Modules/_sqlite/statement.c
+++ b/Modules/_sqlite/statement.c
@@ -59,6 +59,8 @@
self->st = NULL;
self->in_use = 0;
+ assert(PyUnicode_Check(sql));
+
sql_cstr = PyUnicode_AsUTF8AndSize(sql, &sql_cstr_len);
if (sql_cstr == NULL) {
rc = PYSQLITE_SQL_WRONG_TYPE;