Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-02-13 14:57:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-02-13 15:09:55 +0300
commitdae445d94a7a5e1ad38719ea05e5bb0bc76ede84 (patch)
tree5f174cb170079ac62eaf521cb3cec2535162e6bf /source/blender/python/bmesh
parent32660201acaa1138c0fed6ef3fa38f69daa3dac3 (diff)
Fix T85573: Building with Python 3.10a5 fails
Replace deprecated _PyUnicode_AsString{AndSize} usage. T83626 still needs to be resolved before 3.10 is usable.
Diffstat (limited to 'source/blender/python/bmesh')
-rw-r--r--source/blender/python/bmesh/bmesh_py_ops.c2
-rw-r--r--source/blender/python/bmesh/bmesh_py_ops_call.c4
-rw-r--r--source/blender/python/bmesh/bmesh_py_types_customdata.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_ops.c b/source/blender/python/bmesh/bmesh_py_ops.c
index c5d72a00ce3..b23891ca1fe 100644
--- a/source/blender/python/bmesh/bmesh_py_ops.c
+++ b/source/blender/python/bmesh/bmesh_py_ops.c
@@ -245,7 +245,7 @@ static PyTypeObject bmesh_op_Type = {
static PyObject *bpy_bmesh_ops_module_getattro(PyObject *UNUSED(self), PyObject *pyname)
{
- const char *opname = _PyUnicode_AsString(pyname);
+ const char *opname = PyUnicode_AsUTF8(pyname);
if (BMO_opcode_from_opname(opname) != -1) {
return bpy_bmesh_op_CreatePyObject(opname);
diff --git a/source/blender/python/bmesh/bmesh_py_ops_call.c b/source/blender/python/bmesh/bmesh_py_ops_call.c
index d0676ec1947..28daf08507d 100644
--- a/source/blender/python/bmesh/bmesh_py_ops_call.c
+++ b/source/blender/python/bmesh/bmesh_py_ops_call.c
@@ -184,7 +184,7 @@ static int bpy_slot_from_py(BMesh *bm,
if (slot->slot_subtype.intg == BMO_OP_SLOT_SUBTYPE_INT_ENUM) {
int enum_val = -1;
PyC_FlagSet *items = (PyC_FlagSet *)slot->data.enum_data.flags;
- const char *enum_str = _PyUnicode_AsString(value);
+ const char *enum_str = PyUnicode_AsUTF8(value);
if (enum_str == NULL) {
PyErr_Format(PyExc_TypeError,
@@ -787,7 +787,7 @@ PyObject *BPy_BMO_call(BPy_BMeshOpFunc *self, PyObject *args, PyObject *kw)
PyObject *key, *value;
Py_ssize_t pos = 0;
while (PyDict_Next(kw, &pos, &key, &value)) {
- const char *slot_name = _PyUnicode_AsString(key);
+ const char *slot_name = PyUnicode_AsUTF8(key);
BMOpSlot *slot;
if (!BMO_slot_exists(bmop.slots_in, slot_name)) {
diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c
index 96c36f2d788..471a311c411 100644
--- a/source/blender/python/bmesh/bmesh_py_types_customdata.c
+++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c
@@ -804,7 +804,7 @@ static PyObject *bpy_bmlayercollection_subscript(BPy_BMLayerCollection *self, Py
{
/* don't need error check here */
if (PyUnicode_Check(key)) {
- return bpy_bmlayercollection_subscript_str(self, _PyUnicode_AsString(key));
+ return bpy_bmlayercollection_subscript_str(self, PyUnicode_AsUTF8(key));
}
if (PyIndex_Check(key)) {
const Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError);
@@ -862,7 +862,7 @@ static PyObject *bpy_bmlayercollection_subscript(BPy_BMLayerCollection *self, Py
static int bpy_bmlayercollection_contains(BPy_BMLayerCollection *self, PyObject *value)
{
- const char *keyname = _PyUnicode_AsString(value);
+ const char *keyname = PyUnicode_AsUTF8(value);
CustomData *data;
int index;