summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_sqlite/statement.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c
index a5801d6..b1a4e76 100644
--- a/Modules/_sqlite/statement.c
+++ b/Modules/_sqlite/statement.c
@@ -50,12 +50,11 @@ int pysqlite_statement_create(pysqlite_Statement* self, pysqlite_Connection* con
self->st = NULL;
self->in_use = 0;
- sql_cstr = PyUnicode_AsString(sql);
+ sql_cstr = PyUnicode_AsStringAndSize(sql, &sql_cstr_len);
if (sql_cstr == NULL) {
rc = PYSQLITE_SQL_WRONG_TYPE;
return rc;
}
- sql_cstr_len = strlen(sql_cstr); /* XXX */
self->in_weakreflist = NULL;
Py_INCREF(sql);
@@ -216,12 +215,11 @@ int pysqlite_statement_recompile(pysqlite_Statement* self, PyObject* params)
Py_ssize_t sql_len;
sqlite3_stmt* new_st;
- sql_cstr = PyUnicode_AsString(self->sql);
+ sql_cstr = PyUnicode_AsStringAndSize(self->sql, &sql_len);
if (sql_cstr == NULL) {
rc = PYSQLITE_SQL_WRONG_TYPE;
return rc;
}
- sql_len = strlen(sql_cstr); /* XXXX */
rc = sqlite3_prepare(self->db,
sql_cstr,