Skip to content

Commit df284eb

Browse files
Erlend Egeberg Aaslandvstinner
Erlend Egeberg Aasland
andcommitted
Improve error message
Co-authored-by: Victor Stinner <[email protected]>
1 parent 0a6ca75 commit df284eb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Modules/_sqlite/statement.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ pysqlite_statement_create(pysqlite_Connection *connection, PyObject *sql)
6161

6262
sql_cstr = PyUnicode_AsUTF8AndSize(sql, &sql_cstr_len);
6363
if (sql_cstr == NULL) {
64-
PyErr_SetString(pysqlite_Warning,
65-
"SQL is of wrong type. Must be string.");
64+
PyErr_Format(pysqlite_Warning,
65+
"SQL is of wrong type ('%s'). Must be string.",
66+
Py_TYPE(sql)->tp_name);
6667
return NULL;
6768
}
6869
if (strlen(sql_cstr) != (size_t)sql_cstr_len) {

0 commit comments

Comments
 (0)