Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index f37de42..1c6aa54 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -505,7 +505,7 @@
} else if (PyFloat_Check(py_val)) {
sqlite3_result_double(context, PyFloat_AsDouble(py_val));
} else if (PyUnicode_Check(py_val)) {
- const char *str = _PyUnicode_AsString(py_val);
+ const char *str = PyUnicode_AsUTF8(py_val);
if (str == NULL)
return -1;
sqlite3_result_text(context, str, -1, SQLITE_TRANSIENT);
@@ -1527,7 +1527,7 @@
}
}
- uppercase_name_str = _PyUnicode_AsString(uppercase_name);
+ uppercase_name_str = PyUnicode_AsUTF8(uppercase_name);
if (!uppercase_name_str)
goto finally;
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index c7169f6..39f7a65 100644
--- a/Modules/_sqlite/cursor.c
+++ b/Modules/_sqlite/cursor.c
@@ -465,7 +465,7 @@
pysqlite_statement_reset(self->statement);
}
- operation_cstr = _PyUnicode_AsStringAndSize(operation, &operation_len);
+ operation_cstr = PyUnicode_AsUTF8AndSize(operation, &operation_len);
if (operation_cstr == NULL)
goto error;
@@ -689,7 +689,7 @@
self->reset = 0;
if (PyUnicode_Check(script_obj)) {
- script_cstr = _PyUnicode_AsString(script_obj);
+ script_cstr = PyUnicode_AsUTF8(script_obj);
if (!script_cstr) {
return NULL;
}
diff --git a/Modules/_sqlite/row.c b/Modules/_sqlite/row.c
index 07584e3..53342f3 100644
--- a/Modules/_sqlite/row.c
+++ b/Modules/_sqlite/row.c
@@ -98,7 +98,7 @@
Py_XINCREF(item);
return item;
} else if (PyUnicode_Check(idx)) {
- key = _PyUnicode_AsString(idx);
+ key = PyUnicode_AsUTF8(idx);
if (key == NULL)
return NULL;
@@ -108,7 +108,7 @@
PyObject *obj;
obj = PyTuple_GET_ITEM(self->description, i);
obj = PyTuple_GET_ITEM(obj, 0);
- compare_key = _PyUnicode_AsString(obj);
+ compare_key = PyUnicode_AsUTF8(obj);
if (!compare_key) {
return NULL;
}
diff --git a/Modules/_sqlite/statement.c b/Modules/_sqlite/statement.c
index 7b98013..0df661b 100644
--- a/Modules/_sqlite/statement.c
+++ b/Modules/_sqlite/statement.c
@@ -59,7 +59,7 @@
self->st = NULL;
self->in_use = 0;
- sql_cstr = _PyUnicode_AsStringAndSize(sql, &sql_cstr_len);
+ sql_cstr = PyUnicode_AsUTF8AndSize(sql, &sql_cstr_len);
if (sql_cstr == NULL) {
rc = PYSQLITE_SQL_WRONG_TYPE;
return rc;
@@ -152,7 +152,7 @@
rc = sqlite3_bind_double(self->st, pos, PyFloat_AsDouble(parameter));
break;
case TYPE_UNICODE:
- string = _PyUnicode_AsStringAndSize(parameter, &buflen);
+ string = PyUnicode_AsUTF8AndSize(parameter, &buflen);
if (string == NULL)
return -1;
if (buflen > INT_MAX) {
@@ -325,7 +325,7 @@
Py_ssize_t sql_len;
sqlite3_stmt* new_st;
- sql_cstr = _PyUnicode_AsStringAndSize(self->sql, &sql_len);
+ sql_cstr = PyUnicode_AsUTF8AndSize(self->sql, &sql_len);
if (sql_cstr == NULL) {
rc = PYSQLITE_SQL_WRONG_TYPE;
return rc;