diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-20 07:13:07 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-11-20 07:13:07 (GMT) |
commit | 06515833fef7b8b5c7968edf72367d94ff7eb1e0 (patch) | |
tree | 58a7c06bba8141883a5e5c8621d2b0683ae9fe2e /Modules/_sqlite | |
parent | e20973926a2ec19c4b87e460dc6f0edb478ce352 (diff) | |
download | cpython-06515833fef7b8b5c7968edf72367d94ff7eb1e0.zip cpython-06515833fef7b8b5c7968edf72367d94ff7eb1e0.tar.gz cpython-06515833fef7b8b5c7968edf72367d94ff7eb1e0.tar.bz2 |
Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSize
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r-- | Modules/_sqlite/connection.c | 4 | ||||
-rw-r--r-- | Modules/_sqlite/cursor.c | 4 | ||||
-rw-r--r-- | Modules/_sqlite/row.c | 4 | ||||
-rw-r--r-- | Modules/_sqlite/statement.c | 6 |
4 files changed, 9 insertions, 9 deletions
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 @@ _pysqlite_set_result(sqlite3_context* context, PyObject* py_val) } 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 @@ pysqlite_connection_create_collation(pysqlite_Connection* self, PyObject* args) } } - 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 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject* 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 @@ PyObject* pysqlite_cursor_executescript(pysqlite_Cursor* self, PyObject* args) 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 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx) 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* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx) 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 @@ int pysqlite_statement_create(pysqlite_Statement* self, pysqlite_Connection* con 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 @@ int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObjec 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 @@ int pysqlite_statement_recompile(pysqlite_Statement* self, PyObject* params) 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; |