diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-02-13 14:57:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-02-13 15:09:55 +0300 |
commit | dae445d94a7a5e1ad38719ea05e5bb0bc76ede84 (patch) | |
tree | 5f174cb170079ac62eaf521cb3cec2535162e6bf /source/blender/python/mathutils/mathutils_Matrix.c | |
parent | 32660201acaa1138c0fed6ef3fa38f69daa3dac3 (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/mathutils/mathutils_Matrix.c')
-rw-r--r-- | source/blender/python/mathutils/mathutils_Matrix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index 87d16656d70..016ba462030 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -499,7 +499,7 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args) } if (vec && PyUnicode_Check(vec)) { - axis = _PyUnicode_AsString((PyObject *)vec); + axis = PyUnicode_AsUTF8((PyObject *)vec); if (axis == NULL || axis[0] == '\0' || axis[1] != '\0' || axis[0] < 'X' || axis[0] > 'Z') { PyErr_SetString(PyExc_ValueError, "Matrix.Rotation(): " @@ -768,7 +768,7 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args) if (PyUnicode_Check(axis)) { /* ortho projection onto cardinal plane */ Py_ssize_t plane_len; - const char *plane = _PyUnicode_AsStringAndSize(axis, &plane_len); + const char *plane = PyUnicode_AsUTF8AndSize(axis, &plane_len); if (matSize == 2) { if (plane_len == 1 && plane[0] == 'X') { mat[0] = 1.0f; |